Since there’s only one bathroom, I’ve been assuming that engineering just teleports all the bodily waste out of the crew and directly into the replicators’ matter feeds, Hogwarts-style. Saves time, keeps the crew light and active, keeps the transport operators sharp while between planets.
I think that this is canonically untrue. Federation vessels do have multiple bathrooms or “heads” in military jargon, including personal ones attached to officer quarters.
However, Memory Alpha does corroborate the version I remember, which is Frakes talking on some behind the scenes special about how there’s only one bathroom on the entire Enterprise-D. Scroll down a bit to the “Background” section. https://memory-alpha.fandom.com/wiki/Bathroom
(And if you’re surprised there’s a MA page for just this topic, I am too, and probably shouldn’t be.)
Makes sense … but once you teleport a portion of content out of the body, doesn’t that leave a void that has to be filled … leaving room for gas to form? After a big meal and the transporter team beams out that big holiday log out of you, I’d expect to hear a few guys and gals rip some big ones an hour or two after.