Disable/Enable Solver with grasshopper component

Is there a way to disable/enable GH solver inside the script with a component (Python/C#)?
I’m not great at programming and wasn’t able to do it on my own