Simple thing: let us put practically every kind of item (=stuff that goes into an inventory) into barrels, as long as it's below a maximum inventory grid size (I would suggest limiting to items that only occupy 2 squares, so absurd things like a barrel of B12 won't happen).
Mechanic wise the implementation could work as following:
When RMB'ing an empty barrel with a non-fluid item (=anything that currently can't go into a barrel) turn the barrel server-side into a stockpile for that item and put the item inside. The label on the barrel gets the same image as a display sign would get when applying that item. Interacting with such a barrel would work identical to a stockpile (show the usual interface window, LIFO scrolling, ...).
Removing the last item returns the barrel to a as-is currently empty one.
Automated solution to generating the graphics for the contents when looking inside such a stockpile barrel: Blender has a physics engine, enable that and collisions, float a barrel and have blender spawn a series of the (game world) items above it (spread out over some seconds), wait a moment for the simulation to settle, delete all objects that fell beside the barrel or protrude above it, enumerate what's left (sans the barrel) position wise (lowest point of each) bottom to top and a bit of quick math later you'll have a list of positions/rotations (relative to the barrel) specific to that item for the client to render when looking inside a barrel (only a partial of that list being rendered when the barrel isn't 'full') containing that particular item. It should be possible to script that inside Blender so it runs for every distinct in-world mesh (what's drawn when the thing is dropped on the ground in the world) without additional user interaction. Bonus points for letting it run several times for each mesh so there'll be variation in the looks when having several barrels with the same stuff open.