Obviously, I was kidding about the crank operated machine gun, but I think you knew that anyway
As for a real world solution, the government needs to take piracy seriously and dedicateda military response to it. Otherwise, the only real solution is vigilante-ism. I don't know how realistic of an idea that is either, but I'm sure that if a sudden surge of civilian pirate hunting were to make the news, the government would start taking piracy more seriously. The government hates it when civilians do their job for them.