Sure I can see that being a problem. But a gun like a .50 cal can be placed on and off a mount by one or two people. So when in dangerous waters like off the Somali coast, or the straights of Malaca, why not have the gun mounted and ready. But when you get to a peaceful port, just stow the gun(s) in the hold?
There must be some maritime law that says if you're a cargo vessel or not a ship of war, you cannot have weapons on board.
Yeah see, the thing is.....a .50cal example isn't a good one cos a single .50cal isn't really going to be that effective. You've got a manually aimed .50cal and they've got.....what, small arms and RPGs? Somali's start taking .50cal fire and what'll happen is they'll upscale with longer ranged weapons and start punching holes in boats from distance.
Shipping companies don't want big holes punched in their boats.
The real way to go would be a longer ranged, computer assisted gun of some sort. Don't ask me, I'm no expert on maritime weaponry (uncle of mine was a weapons chief aboard HMS Leander, I'll ask him some time) but something more hard mounted would seem necessary rather than a soft mounted, removable .50cal. And that's what would get objected to.
The other problem you've got is when are merchant vessels allowed to open fire? How about a Chinese cargo ship with no actual cargo on boat sailing around the waters of Taiwan opening fire on anything that looked a bit shifty? ie, anything with a Taiwanese flag?
etc, etc.
I also suspect insurance companies might object to lots of high explosive rounds being carried around the seven seas and stored next to the smoking area. Being very general here but you get the idea.
Now, what
is happening is certain cargo companies are hiring permanent additions to the crews of some vessels in the way of ex military shooters. Pirate boat comes close, they start taking accurate small arms fire. Someone told me some governments have objected to this practice but the companies involved have ignored them (good!). So far it's only American companies taking part in this practice. Go Yanks I say.