My most frequent destinations are just over 4 hours away, and it's rarely a problem. I just hold off on the mega-cup of strong black coffee before departure, because caffeine is a pretty good diuretic. One time I forgot, enjoyed my pre-departure coffee, and an hour into the flight, at 12,000 feet, solo, was chagrined to realize I could think of nothing else but the location of the nearest ladies' room. So in desperation, I told ATC my destination was changed to the airport 30 miles ahead instead of the one 570 miles ahead. He wanted to know why I had to land so soon. I sweetly admitted, "Uh, hydraulic issues?" He chuckled and said, "Roger, gotcha, we'll catch up with you on the other side." I swore NEXT time I'll be prepared. I bought a couple of those disposable rigs that have a cardboard folding funnel attached to a plastic bag full of absorbent granules. A wet-wipe packet is included. Next time the need presented itself some years later when we were just 30 minutes from our destination, I had a chance to try the thing out. Set the autopilot, asked the right-seater to keep an eye on things and listen for our N number, excused myself to the rear of the aircraft, and unfolded a sectional chart for privacy. The disposable funnel-bag gizmo worked neat as you please. When the old man is along, he skips his blood pressure diuretic and his coffee that morning, and we plan on legs no longer than 3.5 hours.
Preparing for a 9-hour very-small-sailboat ferrying trip last week, I tried a test-run with a toddler-size overnight-Pamper. Um...good idea... not. Suffice it to say, I skipped the next morning's coffee instead.
Speaking of pee-threads, I swear, the boating forums seem to be fixated on the subject, which is apparently fraught with all manner of difficulties. You'd think cruising sailors spend their whole day in the head.