>>27716879.50 caliber machine guns, probably four, two on the starboard, two on the port side of the ship. Armored plates to protect the gunners, and high quality thermal optics mounted on the guns. Two men on each gun. Another crew of maybe ten men armed with whatever high quality assault rifles i can procure, magnified optics on each rifle, each man gets a PVS-14 night vision device. The ship has defensive positions along the perimeter, hardened armored plate and sandbags giving defenders a place to take cover and return fire from an elevated and stable position.
Each man, even non combatant crew are given gas masks, cs canisters are provided to every crew member, in the event of pirates getting aboard CS canisters are popped flooding the cooridors of the ship with CS, turning the tide neatly in the favor of the mask wearing defenders.
Honestly, that should do it. A larger, more stable platform spraying .50 caliber rounds into a little "pirate ship" is going to fuck them up from thousands of yards, with superior optics the defensive gunners would have an amazing advantage. At 300 meters or less the riflemen will take out more, the pirates can either stop their little dinghy to return fore accuratly, and get shredded by the .50, or attempt to bumrush the ship, taking mass casualties.
Amy that do make it to the ship will have to fight against entrenched defenders while choking on their own snot.
The RPGs generally carried by these pirates would be the only issue, any spare money would go to procuring additional machine guns to prevent the loss of a single gun from opening a weak point.