May I respectfully disagree? Executing individual pirates may not be effective.
Some years back kidnapping foreign diplomats was pretty popular in the ME.
Then the idjits kidnapped a Soviet diplomat.
The kidnappers got off scott-free, but decided releasing the diplomat with something akin to an apology was a really good idea after shredded family members started showing up in garbage bags on their doorsteps.
Hasn't been a Russian diplomat kidnapped since.
A punk kidnapper might be willing to risk his own wretched life for a fortune beyond his innumerate counting, but the certainty of his entire village being burned to the ground along with everything and everyone he hold dear just might give him pause.
The Russian diplomats were kidnapped/killed in Baghdad, and there was a war going on.