Is there a way to turn off all colliders at once when a certain function is called, or a boolean is set to true?
No I don’t think such a function exist.
But you could create one that does what you want. You get all gameObjects using FindObjectsOfType from GameObject, then iterate on the returning objects and finally test if the object have a collider (go.collider), if so you can turn it off
(if you need example of code for iterating on gameObject, I invite you to search on google for something like: unity iterate all gameobject).
I hope this helps you a little.