Isn't this the same problem that money laundering laws have to solve? It's hard, but its not insurmountable.
If you want to stop the hackers, make it a Federal crime to pay anyone. In that environment, there would be no circumventing the restriction at all.
That means that money laundering laws are up against a dedicated adversary with resources, while laws preventing ransoms... not so much.
Of course, with cyber insurance, incentives for the insurer may lean towards dedicated circumvention.