I do have to imagine the "oh s$@#!" reaction from the pirates though when a seemingly innocent vessel pops up a Bofors. Lessee. Pirates, armed with AK variants and maybe RPG-7's. Seemingly Innocent Vessel, armed with a Bofors and a sprinkling of Ma-Deuces.
Hrm. RPG-7, max range is ~900 meters... Bofors, max range... ~7000 meters... And that's in an anti-aircraft attitude. Used as a surface to surface weapon, somewhat longer range..... Warn the pirates away with a couple of bursts from the .50's, and if that doesn't work, open up with the Bofors.... Bet ya the pirate problem would rapidly disappear.....