About something like a marine air horn ...
It's pretty big for the pocket or purse though.
Would a hammer be better? It's not easy to stop a nasty hungry grizzly bear when walking on his trail and tail. I would rather carry the air horn over a hammer.
For an attacker who wants to rob your wallet, credit cards, cash, jewelry, car, etc.,
I have no clue, because he's not telling you that he won't kill you after he robs all your goods.
The stats might say that he won't if you don't resist, some people don't take any chance; a quality Swiss army knife could be handy for someone who knows how to use it efficiently, no muss no fuss. But against a gun? No way, not fair. ...So, do what you have to do with the circumstances when they come, only you knows best...and nobody else because it's your money and your life.
* Non lethal devices against superior fire power. Bulletproof vest? ...Bulletproof helmet?
Can a black belt judo karate master stop bullets?