The Moon would take off in a straight line, at a constant speed, with the
same speed and direction it had at the instant that gravity got switched off.
(Of course, if ALL gravity got switched off, then the Moon would fall apart.
The radioactive and volcanic heat activity in its core would continue, and
suddenly there wouldn't be anything to hold it together. Same for the Earth.)