I was talking with my friend the other day about how Darth Vader goes to the bathroom with the suit on. So I came to the conclusion that he probably wears a colostomy bag. Because it would be to much work to get unsuited and suited back up every time he needed to release. My friend said ya that's probably what he does. And then I said I know then my friend said well ummm.. yea that makes sense then i said well ya know...
He eats stuff and his "droppings" are used to create electricity for his suit to operate.
What little is left after this operation is pumped up into a "vaporizing chamber", located under his chin. There those micrograms of extremely dense poo, will be exposed to a electric current, which makes them vaporize. The vapor is pushed out with each exhale Vader makes.
That's why he doesn't like holding breath too long. Since, if the chamber fills up, there must be an emergency vent, which leads straight to his lungs. (Yes, the second pipe going down to his throat).
Well vader doesnt actually "eat", however (according to Star Wars visual dictionary book) nutrients get released through his mask, there is obviously some system at the other end. With all the cool technology they have in the SW galaxy, i'm sure it's really clean