maritime law saws commercial vessels can't be armed as far as I understand it, hence why pirates can hijack them with little problem.
Not true... It depends on the country of flag. I work on a boat that is American owned, American crew, but we sail under the Marshall Islands Flag. This is done mostly for financial reasons.
There is no "international" law regarding weapons on ships. If my COMPANY allowed it, people could bring whatever they wanted on board, including full autos, rocket launchers, etc, BUT if we did that, we would be restricted as to which ports we could "pull in" to.. Many countries don't allow ships with weapons into their ports, some do... We picked up a British security team (maybe the same one mentioned in the commercials) in Singapore.. Singapore allows shotguns in/out with boats, so we have Shotguns Aboard...
Port Suez in Egypt allows much anything through also, if we were coming back here after our job, we could have brought AK's, AR's, and RPGs on board, but our next port of call would be Singapore, so that's a no go...
The way to avoid piracy on the high sea is to be a hard target... The pirates don't want to be seen coming, if you try to run, they usually let you go. They want to be on board with a gun at the Captain's head before anyone realizes that they are there.
My ship has a roving security team, barbed wire around any grapple boarding areas, very well lit decks, security cameras everywhere, it's highly unlikely we'll even have an attempt on us.
The pirates want the tanker or cruise ship that's got one man steering and everyone else asleep, that makes an easy target. They can board with 2-3 people, take the driver and captain hostage, and then take the ship to the Somali coast to hold for ransom. They don't want a target that is likely to fight back.
So, be a hard target. You'll never have to worry about it.