I've ahd this question for a long time and now I se it being address for runners at least, in the NYT
www.nytimes.com/.../new-york-city-marathon-a-restroom-plan-can-relieve-some-worry.html
I've been lucky that I've always been able to finish the 2.25 mile "race" I do without it being an issue. One year I was in the porta potty for the official start. Another year, I found a bathroom immediately after coming out of the water. I swam kinda fast that last quarter mile or so, too!
I prep at bit before hand - I usually eat high fiber cereal and fruit for breakfast, but on the race day, low fiber cereal and maybe a banana for fruit.
Still I'm a bit concerned on how to handle the inevitable.
Do you just drop your drawers and not worry that there are people swimming after you in the race? Ewww! Would I explain to my kayaker what I was doing? Some kind of plastic cleanup bag?
Nothing seems like good solution.
I imagine that in a marathon, it's more likely than not I would need to deal with this.
I think you can go two and a quarter miles without going, maybe get up earlier and go for a walk or run a little ,might try rice the night before your event ,
Good luck
I've never had this problem but I stick to very low fiber foods for a few days before the swim. On the morning of a marathon swim I eat a HUGE bowl of oatmeal to provide a solid foundation for the liquid feedings. I did have a last minute call to poop before an over and back swim to Alcatraz. I opted to jump in the porta potty. They started the race when I was still running back to the water. Luckily it was only a short way.