What is the formal word for urinating and passing the bowels? If we say 'He went to restroom' it isn't much clear, still. Or if we say, 'He went due to call of nature' it sounds humorous.
I am not aware of a single formal word that takes in both urinating and defecating.
However, there are numerous ways of referring to both these actions.
The expression to relieve oneself serves on most occasions and can refer to either or both.
A host of other expressions, both formal and informal, can be found by clicking on the links below.
Although people visit restrooms (powder rooms, washrooms, lavatories, loos etc) for several reasons, it's seldom necessary to spell these out.
They've gone to the washroom says as much as is necessary unless there's a specific reason to refer to some unfortunate person's problems, such as those with constipation or diarrhea.
Elimination is the single word that encompasses both biological processes, but is much more apt to be used in a medical context, rather than in a colloquial one.