Hello.
The basic swords that you can almost instantly buy at the start of the game(The wooden and the stone swords) are very affordable.
5 or 32 iron isn't a big deal at all, plus you have a few second invulnerability which is a ,,window" that you can use to shop for the basics if you have just been killed and if the enemies are on your island.
Let's say that you use the money bag kit.
With 15 iron you can buy a stone pickaxe, a wooden sword, a full leather set of armour, one steak and even 12 blocks to get away.
I understand, that you might struggle to get out of such sticky situations, there are already some starter kits that are useful like money bag and chicken that can get you out of them.
Plus, it's not rare to see people rushing without any gear whatsoever other than some blocks and pickaxe, so if you are thinking fast, then you will probably handle such situations with the kits that I mentioned.
I'll have to disagree with your suggestion, sorry.
There are already many ways to protect yourself if something like this happens.