I'm in doubt if I should write this as an answer or just as a comment because I think this is is very region dependent
In Colombia you could hear people saying explicitly "la taza del baño/sanitario" referring to the toilet bowl but not just «la taza» unless you are already talking about the restroom and it is very clear to which "taza" you are referring to.
Regarding your second example we always say "pocillo/taza de café" and not "vaso de café" as we use "vaso" for the one you drink milk from and you don't drink coffee on those.
In Colombia hot beverages like coffee, tea, chocolate are usually served on "taza" or "pocillo". This two words could be used to describe a cup but in the more strict meaning a "taza" has no handles while a "pocillo" has one handle but I think that is only for Colombia (perhaps only for the andean part of Colombia)
So as for your questions, there is no slang and no ambiguities. We use «taza» for coffee and we use it for the restroom but we explicitly say which one we are talking about when it is not obvious or implied.
i.e.
Do you want some coffee? Yes, a cup please (¿Quiéres café? Si, una taza por favor)
He was very drunk and spend the night hugging the toilet bowl (Estaba muy borracho y se pasó la noche abrazando la taza del sanitario)
Coffee cup (taza/pocillo de café)

Taza with no handles
