Could you consider something like this :
func _process(_delta):
#look at mouse
look_at(get_global_mouse_position())
# do something with the node rotation
if(global_rotation_degrees < 0):
flip_v = true
else:
flip_v = false
look_at function rotates the node to the mouse so I dont think we need to calculate it again just look at the mouse first then you can do whatever you want with the rotation variable.