In the 1990s, there was a spike in piracy in the South China Sea. At the very end of the decade, in 1999, water-borne rogues dressed as Chinese officials seized a cargo ship near Hong Kong waters and murdered twenty-three crewmen. The ship was never recovered, but the Chinese authorities caught thirteen of the pirates and executed them.Coincidence? I don't think so.
By amazing coincidence, after this pitiless demonstration of non-leniency, incidences of piracy in the waters off Southern China dropped dramatically.
I have reservations about giving that much authority to the state - they have misused it in the past - but it can be effective. One of the people the Chinese executed was a Chinese Customs official who supplied the uniforms to the pirates. China stopped being a haven for pirates. Other states in the area picked up the slack.
We won't be that effective with regard to Piracy off the African coast. Too much like violating the human rights of the "enemies of all mankind."