My understand [sic] of contract law in general, is that an illegal or unenforceable clause does not render the whole contract void, but rather that specific clause is essentially stricken out, as if it did not exist.
This is not true. Or, at least, not necessarily true.
The courts, when interpreting a contract, try to give effect to the parties intentions. Or, more precisely, what an impartial, reasonable person would conclude their intentions at the time were based on the evidence.
A contract is a set of mutual promises - if one of those promises is unenforceable, was it the parties intention that:
the remainder be enforced, or
absent that promise, they would not have made a deal, or they would have made a different deal, say, at a different price?
It’s hard to make general statements about severability because they turn on the particular facts of each case.
However, the common law doctrine is that severance means severance - you can take words out, but you can’t add words in or change the meaning of words you left behind. If doing that leaves nonsense, then the clause can’t be severed, and the whole contract is void.
Further, what’s left must still be a contract. If the severed portion leaves a remainder that does not meet the requirements of a contract (e.g. because the severance totally removed one party’s consideration), then the whole contract is void.
Similarly, if the severed item is central to the purpose of the contract, then the whole contract is void.
Finally, at least in Common Law countries, there is a difference between provisions that are unenforcable (e.g. unfair restraint of trade clauses) and those that are illegal (e.g. your murder before resignation clause).
In most jurisdictions, if a provision is unenforcable at common law or through statute, severability is an option. However, if the provision is illegal, then responses differ.
In England and Wales, a provision that requires criminality or the commission of a tort cannot be severed - the illegality 'infects' the entire contract and makes the whole thing void. However, in Australia, the degree of illegality matters - heinous illegality infects the entire contract, but incidental illegality may not. For example, see REW08 Projects Pty Ltd v PNC Lifestyle Investments PTY LTD [2017] NSWCA 269 [23 October 2017] - the NSW Court of Appeal ruled that a property sale that contained clauses designed (by both parties) to defraud the state of Stamp Duty was nevertheless enforceable against the vendor - this would likely have been decided the other way in England and Wales.
Of course, many contracts make express provision for unenforcable terms in what are known as severability clauses. These can go further than mere severance and allow the court to add words or even redraft entire sections to preserve the contract. However, this is not a panacea because what you agreed to in your severability clause may not be what you thought you agreed to when the rubber hits the road. For example, when you are forced to sell your Picasso for the 1,000USD deposit only, and you can't get the 100,000,000,000 Iranian Rial balance due to US sanctions.
Therefore, deliberately leaving unenforcable provisions in a contract is dangerous because you don't know what you are going to get.
However, is it unlawful?
Well, that depends.
There is nothing wrong with making legally unenforceable agreements. You and I can agree to go to the movies this Thursday. That's an unenforcable social arrangement, not a contract. If you stand me up, I can't sue you even if I bought popcorn for you.
Similarly, there is no prohibition on having unenforcable terms in an otherwise legally binding contract, particularly if everyone knows they are unenforcable. Indeed, many large contracts are accompanied by Memorandums of Understanding that are unenforcable statements about how various organisations intend to work together to give effect to the contract.
However, if the term is included to be deceptive or misleading by one party against the other (intentionally or otherwise), there may be legal consequences. A person who was misled into entering a contract may be able to have that contract declared void. Also, many jurisdictions make misleading and deceptive conduct in trade or commerce an offence.