Locking phases (shorting them together) works to make it harder to pedal, but the two main ways of doing that are easily defeatable, unless you have an electronic lock that is a part of the controller itself, and requires a "key" they can't bypass.
The first is a break-before-make 3P2T switch (or equivalent relay(s), that toggles between all phases shorted together and each phase connected to its controller-side wire. This switch will have to be large, and capable of handling the max phase currents (can be much more than battery currents) of the motor, as well as the max voltages involved. It's been done with smaller switches, and with relays (including those not rated anywhere near hgih enough), and worked, for both this and for delta-wye switching. I have a little toggle switch that was planned for a small geared-hub bike (DayGlo Avenger) but I never did get around to doing that.
FWIW, the most undefeatable way of doing this is using relays inside the motor itself (as is done for delta-wye), whose power-off state is shorting phases...but there is a risk. Vibration on a normal ride could cause relay chatter that causes one or more of the relays to disengage controller-to-motor and instead short the phases. It would require two relays to do this at the same time, so it's not all that likely, but it could happen. BUT if power to the relays was ever interrupted on a ride, it would suddenly short all phases together at whatever speed you were going...and you wouldn't be going that speed anymore. Bad juju. There's ways to prevent that from happening, with a switch (using a locking cover to block it's movement, etc), unlike relays (most, anyway).
And if even one relay does it, it could arc across controller-motor connection and burn the contacts and keep you from riding further, if the current for that phase couldnt' get thru anymore. You'd have to open the motor to fix it.
The second is using an interconnect plug/harness (connecting controller to motor) that you take away from the bike, and replace with a shorting plug on teh motor phases instead. THis is harder to bypass, but if they are aware of it and know what you do (observation of target) they can pull that plug and pedal off, or even have made their own interconnect harness to reconnect the controller to motor (though if you don't have the pins 1 to 1 on there, the chances of them happening upon hte correct phase combination is relatively low).
There's ways to make each of these harder to defeat, of course.
A physical lock that prevents parts from moving is probably easier for the common thief to defeat, vs the electrical/electronic kind, but if it's beefy enough or awkward enough to get to with portable tools, it could slow them down enough to get stopped before you lose your bike.
Using multiple "locks" of whatever type will increase the time it takes to steal your bike...but remember that the typical bike, even relatively heavy ebikes, is still light enough for one person to throw in the back of a truck and drive off, to defeat the locks at leisure, or part it out. They do this with motorcycles using teams of a few people....
Even bigger heavier bikes like mine are still vulnerable to that, though it's less likely they'd want mine given their highly custom nature (recognizability) and ugliness.
So that's why my interest in the locks...especially since I have made both my main rides "prettier" than normal, and thus potentially more desirable (definitely more attention-grabbing). The more stuff they have to defeat to take them, the less likely they'll do so while it's out of my view or access.
Still, the best way to not lose your bike is to not leave it unattended / not visible to you, for even a fraction of a minute.