The pirate problem is not very serious, and also easily resolved.
1) especially with Vasari (when they will come) pirates give you money through salvaging their derelicts.TEC rebels do not even have the problem of fighting them.
2) you can pay them too (difficult or not to win the bid).
3) They are very vulnerable to corvettes early on.
4) Later you just kill their base for Titan experience (I am assuming this is singleplayer).
The only thing is when they become upgraded in late game, in multiple star maps, yet a few hits by a novalith or an all-out attack carried out anticipately in colonizable starsystems can resolve the issue before you have to deal with their upgraded raids.
In the rare circumstances when you cannot muster a force, just scuttle everything in the gravwell for some money, and early on they just go away. Later, you'll have to recolonize because they have siege.