Otherwise the closest analogy to a readable active might be .activeSelf or .activeInHierarchy, but neither is a precise 1-to-1 match, which is why I suggest your own boolean.
Notice that this flag is what keeps track of the state.
Replace this flag with a flag of your own (thus a boolean variable as Kurt said).
Pass this value to SetActive.
Recommend not to use SetActive, that turns everything on and off. Just enable/disable the renderer, which makes it visible/invisible. You can do this to the collider too if needed. If there’s a Rigidbody the parallel command (sort of) is isKinematic, there’s no direct enabled/disabled for these afaik.
It does make sense to do this, but I’d warn against the idea that this somehow is preferred over the other more general solution, because toggling the renderer on and off is very specific and situational.
That’s like saying “To turn your engine off, you don’t have to turn the key at all, the recommended way is to open the hood and unplug the electric cables. This will prevent the spark plugs from firing off, and the engine will cease to function.”
True, I was mainly cautioning against the possible issues with the GO itself being inactive (like script functionality). Different situations will call for different solutions for sure.