Please describe your proposed solution
We must allow malformed datums to be refunded to the user, this would take the form of a redeemer constructor and case in the validator that will check for the malformed datum and then return the spent utxo to the user. This operation could be automatically included, and common tools like pluto, aiken, and plutus (Haskell) could change their generation to automatically include this case, so even when not explicitly considered by developers we can ensure such a simple mistake, that can happen on any part of the stack, doesn't cost somebody the entire output paid to the script.
We propose to update the Aiken and Plutus libraries to support this automatic withdrawal functionality, rendering users unable to burn assets due to an error in code execution.