From the booklet of Rabbi David Shalom Naki, shlit"a: Rabbi Matya ben Charash would not look, even when the Satan stood before him, and the Shulchan Aruch rules that a person must distance himself from forbidden sights very, very much. As the Rambam writes, thoughts of arayot overpower only a heart empty of wisdom.