Marines, Yard Arms, and Ropes
If we make it clear that the civilized countries will see that every single pirate who attempts to hijack a ship can count on being hanged, if he is not shot resisting capture, the incentive will vanish. Brief trials should be held on the decks of the capturing ships and the pirates summarily hanged and fed to the sharks on the spot.
