Of course, it's impossible to talk about pirates without talking about gender. As I've written about here before, I was drawn to the topic when I discovered Feridun Fazil Tulbentci's 1948 Hayrettin Barbarosa is Coming, which uses Ottoman history as a site to articulate a "modern" form of male sexuality.
More recently, though I stumbled on a fascinating article by Judith Tucker about gender and piracy in the in the Mediterranean. As with everything in history, it's complicated. You should read the whole thing, but in short, manfully fighting pirates could be a way to perform your masculinity, while being sodomized by pirates could call your masculinity into question. Also the threat that pirates represented to female virtue could, in the 16th and 17th centuries be a means of reinforcing patriarchy by keeping women off the high seas, but then, by the 19th century, also serve as a discourse justifying European colonialism in North Africa.
Alternatively, you can go directly to one of Professor Tucker's most engaging primary sources instead: "The Worthy Enterprise of John Fox, an Englishman, in Delivering 266 Christians out of the Captivity of the Turks at Alexandria, the 3rd of January, 1577." in all its glory, after the jump.