Thank you for trying to help, Pi-C.
But I think this mod does that, what you described in your post. The only difference is, instead of searching every slot the character has, this uses this simple command on the player to clear the entire inventory.
The problem right know is the loading order. If mods, which have on_player_created() events and use this to add new items to the player's inventory, are loaded after this mod, the "clear_items_inside"-command is executed too early (before the items are added to the player's inventory by the said mods), which results in a player still having items.
Edit:
After a quick research, it seems like using the optional dependency-method to change the mod load order is the only way to achieve a clean inventory with the on_player_created()-event. Another (ugly) way would be to use the on_nth_tick() event as well, setting some kind of variable in on_player_created-event, waiting one tick (or longer), reset the variable, unregister the on_nth_tick()-event so it doesn't constantly fire again and finally clear the inventory.
Edit2:
Actually, I don't think you need that variable at all I think.