I don't think you can get a node's collision layer or mask (Never mind, you can. See njamster's answer) but you could use groups to accomplish what you are trying to do.
var collision = move_and_collide(velocity * delta)
var collider = collision.collider
If there is only one player then you could also use its name instead of using a group with only one node.
if collider.name == "Player":