What's the best way to handle scummy taxi drivers that add chargers and won't let you out, unless if you pay?

So honestly I've gotten into a few situations where I've felt really uncomfortable with taxis.

Taxis have locked the door and refused to let me out until I pay. Sometimes they have gotten confrontational and then I feel quite unsafe / uncomfortable.

Honestly, what would you do? Like it's maybe a bit heated, tense and yeah, not a nice bloody situation to be in (especially if you're alone). Like YOU know that the trip shouldn't cost 58 bucks or 40 bucks etc.