> all of those things would still cause problems with branching and merging
The deadlock most certainly would not. One would get rebased on top of the other, in the worst case.
(In the best case, Alice and Bob would both be committing/pushing to their respective branches early and often, and could therefore look at each others' branches and see what changed between them; if you really want to emulate locking, you could do so pretty straightforwardly by checking if there are any changes to that file in commits outside of your own branch's commit history, and it should be doable to write automated tooling to that effect. All the "benefits" of locking without getting in the way of anything.)
> And in a world where you can only rebase, locking actually makes sense.
Even in a world where you can only rebase, locking is far more of a hindrance than a benefit, for the reasons already outlined.