Yes, they can be a bit of a shock the first time you see them. But they can also be your knight in shining armor. If your game is going badly, the Pirates! event is one of the best possible things that can happen. Yes, they will clean you out, but they will also clean out all of the other civs.
The AI doesn't deal with them very well. It will keep building ship after ship, and sending them to their doom. You don't have to do this. Just sit back and research you *ss off. Then, when you get towards the end of the tech tree, build a single Uber-ship, and wipe the Pirates! off the map. You'll be so far ahead in tech, that you can then wipe the other civs off the map as well.
See? They are not necessarily bad. You can go from certain defeat to a crushing victory, all thanks to your new peg-legged friends.
The Peacekeepers can be handled in much the same way, and the Jagged Knife offers up a whole slew of juicy planets that you can take without worrying about going to war with any of the major civs.
The megas are what you make of them. You can pull your hair out, or see them for the opportunity that they are.