They cost a fortune and take forever to build (five years IIRC), but once you've got one built you can turn it into an impregnable fortress. For a Ringworld:
Max Cargo Spaces := 64000
That's space for 2560 heavy fighters, or 106 heavy weapon platforms, not even considering that if you were really insane you could stick up to 100 cargo facility IIIs there for an additional 300,000 cargo spaces (12,000 heavy fighters! You probably _can_ have that many there, since the unit limit only applies to what's in space not what's in storage). It'd take a while to build all those cargo facilities of course, but you can use the base space yards you used to construct the thing in the first place to supply the units.
If you built a sphereworld instead, double all the numbers above; 29,120 heavy fighters or 713 heavy weapons platforms for a sphereworld packed to the gills with cargo facilities. Ringworlds and sphereworlds are inherently immune to planet-destroying and sun-destroying weapons too, BTW. No need to waste resources on gravitational shield facilities for them.
And then, once you've spent hundreds of turns building the mother of all fortresses, you can lose it to a puppet political party thanks to the 1.41 CI bug.