Honestly, I’d ignore it and just wait for the phase to pass. Unless you can figure out some way to prevent him from being able to stick his hand down his shirt, there’s not much you can do. Maybe with the onset of fall and winter, you can dress him in turtleneck shirts with a onesie underneath and hope it becomes too difficult or uncomfortable for him to get his hand where he wants it.
You can try reminding him to take his hand out of his shirt when you’re out in public, but the attention span of a toddler makes it difficult for him to remember, and most likely you’ll just drive yourself crazy with the repetition. I read somewhere that kids will not stop things like you describe (or picking their noses, for example) until they are old enough to be aware of the social stigma from their peers. As strange as it may look, he probably isn’t going to cause himself lasting damage and punishing him for something that isn’t really “wrong” or “bad” isn’t a course of action I’d suggest.
When my youngest was little, and up until he was two or so, he like to shove his hand down his pants. He mainly did it when he was tired or sleeping, but eventually he stopped. Because it wasn’t a sanitary habit, if I saw him at it during the day I’d take him into the bathroom to “wash the potty germs” off of his hands. It didn’t take long for him to only put his hands down his pants when he was very sleepy. At night, I’d dress him in one-piece footed pjs or put a onesie on him so he couldn’t get his hands into his diaper. Either because he couldn’t do it or just outgrew it, he eventually stopped.