I agree. I don't like the solution either, but it is what it is. What worries me is that if the envvars aren't set, there's a potential for leaking information.
But, it's still possible to disable these features, so it's not quite as bad as the OP suggested.
But, it's still possible to disable these features, so it's not quite as bad as the OP suggested.