Nature calls when nature calls.
However, with games lasting like 20-30 minutes maybe, you're gone for a huge percentage of the game. During which you're effectively crippling your team as you're not providing pressure in your lane or via the jungle. You're coming back as a non player essentially since you're behind in everything like xp and items.
It's understandably frustrating for teammates that you abandoned them mid match. You return yes. However, that doesn't detract from the fact that you abandoned them for a good 50% to 33% of the game.
My suggestion is to understand that your team being frustrated is expected, and that you had to take care of your needs is expected as well. It is just one game, but like people have mentioned try to plan around it so you're not doing it every time you play. There is a reason that most of the time 4v5's are lost.
A final thought about what you can do... don't take 10 minute craps. Not sure how to go about this one, but it definitely does not take me 10 minutes to poop.