How do I clear inventory?

I'm trying to set up the game so that instead of "game over" when they die, they return to the beginning again, losing their skills, level ups, but also all their inventory items, weapons and armors. I tried to set up a common event where it removes every item but the problem is there are so many items to remove that it just freezes when it reaches this point. Is there a specific command, code, or method that I can use in order to clear the character's entire inventory and resetting their levels, stats and so forth?
Is there a specific command, code, or method that I can use in order to clear the character's entire inventory and resetting their levels, stats and so forth?
You can try doing an initialize on each actor then empty the inventory.
$game_actors[1].setup(1)
$game_party.init_all_items

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-clear-inventory.151616/