Not sure about how to avoid committing sexual harassment? Here's a useful Q&A. (Material in quotation marks, except for "right to sexual self-gratification...," is from the link.)
May I proposition my students?
May I flirt with my students?
May I engage in what I'm sure qualifies as sexual banter with a graceful intellectual tinge?
I'm a [insert ideological position/minority/disadvantaged group here]. May I proposition, flirt with, or otherwise engage in sexual banter with a graceful intellectual tinge with my students?
Students are adults! Given the realities of my academic life, they're my primary dating pool! Why can't I do 1-3 above?
Unless you're a Vulcan in the throes of pon farr, and will die unless you have sex immediately, you can wait until the student is either a) not your student or b) not in any way under your control. That is, assuming that your institution does not prohibit faculty/student relationships altogether.
In other words, act like a mature and professional adult. This should not be too difficult, even for an academic. (Then again...)
I only flirt/proposition/banter as part of an "experimental learning endeavour." It's a matter of "academic freedom"!
I don't quite see "the right to sexual self-gratification, direct or indirect" anywhere in the AAUP's statement on academic freedom. And shocking as it may seem, most students find other methods of educational development and intellectual stimulation more helpful.
Why don't students have a "sense of humor" about sex?
Students do have a sense of humor about sex. They're not required to think your attempts to gratify yourself at their expense are particularly funny.
If this goes on, we'll never be able to mention sex in class again!
I'm guessing that there are historians of sexuality on your campus. Perhaps you might inquire how they manage to teach their classes without being fired?