He's at an age where he may need help keeping his anal sac cleaned out. Cleaning out an impaction is just one of the regular chores of having an older male guinea pig.
You do need to be careful when doing it, though. The reason they get impacted is that the muscle in the anal sac lose strength. And if you push too hard trying to get the poop out, you stretch them even more and make the problem worse.
He doesn't need a vet visit, he doesn't need gripe water, he just needs a regular cleaning routine. He probably doesn't like being flipped on his back, and would be more cooperative if you hold him in your lap, his back to your chest, and clean him that way.
Have you seen this?
https://www.guineapigcages.com/forum/threads/85830-Awesome-video-on-how-to-clean-the-Anal-Sac