The only solution I see is if surounded by a mob, shoot yourself and play dead. It’ll scare em to death.
When surrounded by a hostile, violent mob, draw your weapon and shoot whoever is facing you with any sort of weapon. Most likely at that point most of the mob will decide they don't want to be next. Continue to fire any any who don't immediately run.
You may not get out of it, but if so you wouldn't have gotten out anyway, and taking a few with you will be comforting at least.