How to stop rendering widgets?

We tried to use ShowHUD command, but it is only stop HUD ui drawing. But we need to hide all UI objects like widgets created in viewport. Is there any way to stop rendering widgets without creating master widget?