Concerning pirates...
It seems when they appear, they 'take the form of' the most powerful ship in the 'verse (at least -- weapons and defense-wise).
Since I don't usually build ANY ships beyond colony, constructors, surveyers, and miners till I've run the tech tree (and this strategy usually also means I sprint way ahead in techs) -- I've found the pirates - even when their are a lot of them, aren't all that tough to deal with.
For one thing, they focus exclusively on the weapon/defense of the most powerful ship. Last night, when Pirates appeared -- one race had gotten to Graviton Drivers and some middling form of armor.
All the pirates had rather powerful mass drivers and armor -- but no other weapons and defenses. Fortunately, my starbases were pretty much able to take care of themselves (though not the AI starbases... sux to be them

--- and I simply started churning out my "Buccaneer Blaster" class ships... big-time armor, but all missiles and lasers.
From there, I just went pirate hunting... I got a LOT of veteran ships that will later be upgradeable to more balanced models. The pirates did have a couple HUGE fleets that were tough to take out, but in the end...
Despite the havoc they caused - I feel that I actually came out ahead. Before the pirates arrived - I had no offensive ships... now - I've got a fleet of dozens of veterans with high HP that will be great for upgrading when I'm ready to start attacking the other AI races.