M.M.
I think I'd change his diet first.
Could be a dairy or gluten issue, if it happens all the time.
Have you tracked when he's telling you it hurts?
Beyond that, I think some plain old Bean-o or an antacid would do the trick. I don't think either of those are particularly dangerous for kids.