Simple question, hopefully, as I am having trouble finding it. What code do I use to set a light2D's layer to true or false?
You can use the documentation to find the answer. The page for the Light2D is here:
https://docs.godotengine.org/en/stable/classes/class_light2d.html
First, you can use the "enabled" property to turn a light on and off.
For the mask, it appears this is part of CanvasItem (you can see the Light2D parent classes on the top and click them). I think the value you want is "light_mask".
https://docs.godotengine.org/en/stable/classes/class_canvasitem.html#class-canvasitem-property-light-mask