USB connectors could be made with a hole, enabling a ball bearing in the port to engage (similar to hex bit holders), while maintaining compatibility with their unequipped counterparts.
The bearing could be simply spring-loaded to provide moderate resistance to accidental disengagement (along with
the satisfying click of engagement).
Additional options include:
Manual locking for things like chargers.
Electronic dynamic locking for drives while writing data.
A hole in only 1 side of the plug so you can decide whether to use the locking ability.
The port could detect an otherwise undetectable insertion (a broken device, just a cable)
Manual unlocking for the inevitable times that Windows refuses to let go.
Disclaimer: You all know that by 'ball bearing' I mean a steel ball, such as might be used in a bearing. The 'bearing ball' if you will (this disclaimer made me think of a 'Ball-bearing USB', which would be the phone/laptop equivalent of truck nuts).