hitPosition without logic bricks

Normally you would use the hitPosition function as follows


import bge
cont = bge.logic.getCurrentController()
sens = cont.sensors['MouseSens']

# hitPos returns [x,y,z]
hit_pos = sens.hitPosition

What if I wanted to utilize hitPosition without using logic bricks?

EDIT
I found this http://blenderartists.org/forum/archive/index.php/t-219182.html where it was determined a ray cast at the mouse from the camera would solve this issue. The code looks too intricate to consider it a reasonable replacement. So unless anyone has any better ideas, thanks anyway!