Is it possible to implement this for bash? It is the de facto default shell in the vast majority of environments.
I think it will be very convenient for configurations where a password is not used.
The possible workarounds look very scary.
This problem is not specific to a particular command and is relevant even for such basic things as cd and ls