Sorry to interrupt, but I have a suggestion for storage. What if we made two types: 1) For loot with loot, which disappears after closing and works on the principle of distribution when there is not enough space in the inventory. 2) For permanent storage, which will work like the inventory of another character (you can even assign multiple storage characters in the database through the plugin settings and use independent storage). In theory, this will solve the problem with saving and loading.
Your suggestion is interesting, and I had never thought of it. We could actually work with a temporary variable that isn't saved in your savegame and the permanent storage variable, which is the one that is saved. In theory, it works perfectly and isn't particularly difficult to implement, but I don't think it directly fits with general survival mechanics, where a limited inventory forces the player to make choices about what to take, and it breaks the immersion of RPGs where items don't usually disappear. The idea is excellent, but I believe it only shines in very specific scenarios. I'll note it down here with your name, so if it's applied to a future mechanic, I'll give you due credit and let you know promptly.