The Gizmo class has a function called SetEnabled which can be used to enable and disable gizmos. When a gizmos is disabled, it will not be drawn and it can not be interacted with.

The following code shows a simple example of how to modify the enabled state of a gizmo:

// Assume 'myGizmo' is of type Gizmo
myGizmo.SetEnabled(isEnabled);

If you have access to an object transform gizmo instead or any other gizmo behaviour, then you can access the parent gizmo using the Gizmo property:

objectTransformGizmo.Gizmo.SetEnabled(isEnabled);