Programmatically turn off layer visibility for specific layouts

Hello, I´m baking a bunch of objects via grasshopper to one layer (as you can see in the screenshot). I want to show this layer only in specific details or in specific layouts (doesn´t matter).

Sure, I could hide the layer in each layout manually but since I have 50+ layouts this is not the preferred way. The new layer is also created each time “on the fly” so I cannot go through all layouts each time I´m using my script. I would like to turn off the layer after it was created and the objects have been baked.

Is there a way to turn a layer on/off for a specific set of layouts programmatically?