Almost all my ships are built with the possibility of attack in mind. Those that aren't are only used in circumstances where the chances of being attacked is so remote I am happy to take the risk of rebuy, for example I have mining ships that I run shieldless for extra capacity while exploring, but can be fitted with shields at the expense of cargo capacity if I feel the need.
When returning from an exploration trip or other circumstances where I might be flying a more heavily compromised ship I plan my approach into populated systems, usually switching to a safer ship or persuading other Cmdrs to escort me in but occasionally by switching to solo before I jump into potential danger (from players).
If you don't know a system is a ganking hotspot (a new CG for example) you quickly find out, and may have time to escape before being engaged. If you do know in advance, you can plan for it. I find that contingency planning kinda fun, and it's a large part of why I remain in Open even when most of the time the chances of meeting another Cmdr is remote.
From the gankers perspective it's just an easy kill, and move onto the next. If they meet any real challenge they may rise to that & both part ies have some fun, or they may run for safety. Or they might get some friends together & try again
Eating a rebuy to a sore winner that laughs at you is embarrassing

All the more so for an experienced Cmdr who should know better than to fall into a trap like that. I try to not fall into that trap (while remaining in Open with an empty blocklist), and if I do, accept they beat me & congratulate them if I have the opportunity (if they accept a friend request & aren't just a jerk, ime many aren't).