The old reddit trick is to activate a large muscle group so the blood diverts its flow. But since you're having this happen while you're activating a large muscle group, may I suggest compression shorts? I think the problem may be more that the slight rubbing of your penis against cloth/skin may be providing enough stimulation to wake up Johnny. Compression shorts will keep you from jostling him in his sleep.

Give yourself 2+ hours after your meal to when you run.
(Rough estimate for myself, could be different for you)

Avoid chewing gum. Gum can cause air swallowing which leads to excess gas in the digestive tract.

Adjust your diet.

And if worst comes to worst, recognize this is a natural and ultimately unavoidable issue. Pretty much all track athletes male and female have had run-farts in their lives. Just laugh it off and blame that lunch burrito.

I have stomach issues. Have had these issues since middle school. Essentially I constantly feel like I have stomach issues and have to use the restroom, when it's either nothing or gas. So I had the same issue when I started running last month ( first 5k in july!). Few tips I've found that worked are:

Poop before you run, if possible

Watch your diet. Obviously if you are a gassy person, then find a way to nullify this.

But the thing that worked best for me is stretching. Certain stretches and yoga poses, really help move gas through your body. So do some research into these stretches and poses and do them before running. It'll help clear out the system and help you streatch before a run at the same time.