[...] while I was forced to pass through Thargoid-controlled space [...]
Moving past the fact there are already several other threads on this in Dangerous Discussion(one thats like 30 pages), and St0rmFury has already given you the short version of the tactics once encountered, but you are
never forced to pass through Thargoid-controlled systems.
I would suggest learning to use the Galaxy Map filters.(Pilots Federation Mode > System State Filter > Uncheck all Thargoid related system states, Alert/Invasion/Control/Counterstrike/etc)
Then, you can safely travel the
Bubble with no risk from Thargoids.(It's still possible to run into Thargoid Hyperdictions in the Pleaides and other nebulas, but as far as I'm aware those Thargoids are still peaceful if you don't shoot them or have cargo that makes them angry)
It is completely optional content. Intentionally flying through a warzone and complaining you were killed is nonsensical. There's a warning pop-up window in the top-middle of the screen when you begin charging a jump to unsafe space. It's there for a reason.