I've been to quite a few Caribbean ports, some Canadian, some US (on a US-based ship), and a few European. In most cases, we were lugging a bunch of stuff (a beach-bag, maybe snorkeling equipment, kid-stuff [back in the day]).
In no instance that I can recall did anyone in the port look at what we were carrying (of course there was no obvious food being carried).
They very often force you to walk though the shopping area to get off and get on the ship. I tried to by-pass the shopping, and that's about the only time I got attention from customs/immigration/port cop, or whatever. So they're much more concerned about selling you something.
If you want to nab something from the buffet and bring it ashore, do it (except maybe fruit in some ag sensitive place). I never bothered because eating in a restaurant ashore is kind of fun, and you can get some interesting local foods that way.
Edit: I skimmed that cruise critic thread and, as is typical over there, they have a bunch of highly opinionated posts taking the cruise lines' party line. But not one post mentioned the elephant in the room: it's an extra expense to the cruise line. And lost revenue for the port businesses. Those two business concerns aren't getting that incremental spending...that's at least some of what's driving the "rules".