Is it possible to disable functions/methods?
If you don't want a function to run you can just return at the start of that function:

void myFunction() {
    if (!myFunctionShouldRun) return;
    ... rest of function ...
}


If myFunctionShouldRun is false the if will be true (due to the !) and the function will return.  If it's true the rest of the function will execute.