But how would that work in a video game? If they can’t undock, there would be no more gameplay around crime.
I’m not sure you are looking for advice, but there are many things you can do to make yourself a less attractive target to pirates. All you have to do is survive for 20s or so, and the police will save you. Once you understand that, it is pretty easy to take some precautions to make yourself harder, and thus more costly to explode.
But otherwise, how do you balance risk like this? If someone undocks with a billion ISK in their shuttle and just floats there in space while they go make a sandwich, should they not be exploded? They made a mistake, and were outplayed by the pirate.
There are plenty of people here who can give you tips on how to haul safer. But you can start here already to get some basic advice: Hauling - EVE University Wiki
There’s not. Piracy takes much time, patience and preparation and after that, you still can only turn a profit if the other players makes a mistake or two. Grinding PvE efficiently is a much more lucrative and much more reliable source of income.
Also, it is completely possible to fit your ships so they are not profitable to explode in highsec. That doesn’t guarantee it won’t happen, but it is way, way, way less likely if the suicide ganker is going to lose ISK on the criminal act.
Lowsec there is still punishment - there is a security status loss (which has an impact, although being an outlaw is much easier in lowsec), but there is no near instant response from an unbeatable, omnipotent police force. There are are gate and station guns in lowsec which shoot criminals however.
In nullsec, there is none of this: no security status loss nor gate/station guns to protect you. There are also warp-disruption bubbles there which make it much more dangerous to move around.
But in all of these place - nullsec, lowsec and highsec - there is danger from the other players. That is by design. It is much safer for most activities in highsec, although there are cases where you become profitable to explode.