The root of the problem, as someone who ran with IBS for four decades, is plant fiber, especially bran fiber from grains. Steer clear of whole grains especially but fiber in general the week before a marathon. Eat lots of saturated fats like butter, coconut oil and bacon to keep the system well lubed and protected from irritation.