In a house where I don't know where the bathroom is, I ask, "Where's your/the bathroom?" Usually in an aside, not as part of the general conversation. I figure no one really wants to know that I need the bathroom.
If I know where the bathroom is, I'll just quietly excuse myself for a moment. Or, with one side of my family, I'll say, "Got to go use the facilities."
Everybody needs to use the bathroom at some point in their day. But there's a polite fiction surrounding its use. We don't talk a lot about it and many people use euphemisms instead of coming right out and saying what they mean. It's a lot like farting and burping--we all do it, but society asks us to minimize the effects on others and to not make a big deal out of it.
Different people have different standards on this matter. I know households where people will say, "Gotta go poop," and I know households where no one ever says the word "bathroom." It's a "restroom." And saying "toilet" out loud? Oh, my dear, the eyebrows would rise so high they'd never return to normal.
In all matters bathroom-related, if you aren't sure of the standards of the people you are visiting, I'd err a little on the side of being more discreet, rather than blunt and open, as the safer option in offending the least amount of people.