You can’t wish away inflation, it affects companies just as much as it affects us. All their inputs into their goods are more expensive too.
I suppose truly deceptive versions of this are possible, but for the most part even if you don’t pay attention to the exact weight or volume, you can see what you are getting. A chocolate bar, bag of fruit, etc. It’s right in front of you, and in many cases you pick it up when you buy it. I don’t even know if a chocolate bar from this or that company are the same size normally anyway. Boxes of cereal come in all sizes at the best of times, so if you really care about the weight you're getting you have to check it carefully anyway.
There are already laws mandating that weights be displayed in packaging. As a consumer I just accept the fact things are more expensive, for the company selling me stuff just as much as for myself. It’s up to us as adults to make sure we’re making purchasing decisions that are appropriate for our situation.