One could theoretically invent a 'suicide cord' with a relay inside which only connected the ends together if it detects it is connected to the main breaker box and is not connected to the grid.
That could be done by having a keychain-style device that clips around the incoming electricity cable to your house and sends a signal that would be detected by the 'improved suicide cable'.