I've noticed that the younger kids in elementary and middle school will stamp their feet around with their hand up, whining this phrase to an instructor that could care less. Obviously, it has become such a standard that kids will automatically bang these words out in whiny, drawn-out succession when the need overcomes them.
This isn't effective, as teachers hear it all the time. You need something a bit more attention-grabbing than this tired old phrase.
Do what I used to do. It's guaranteed to get people's attention, and probably make them think twice about ignoring your plea:
"I have to urinate, and I'd prefer to do it in the bathroom."
The teacher would usually look up with a puzzled look, and utter something to the effect of "...what?" to which I'd reply "I obviously don't need to go to the bathroom; my urine will patter just as nicely here in the carpeted classroom as it would gurgling into the toilet. However, I don't think you or my classmates would appreciate that, so I'd like to head over to the bathroom if that's okay with you."
Usually, it will take a few seconds for what I said to actually register, at which point they consider their options and eventually make the intelligent decision.
I silently wished for the day where one brave teacher would refuse, however that never happened. Most of my teachers knew me a bit too well and were never foolish enough to try me. Damn.