The commands set gui toolbar off and set gui menubar off just disable certain actions on the toolbar or menubar, instead of hiding them entirely. set gui { toolbar, menubar } on does nothing as its a session lockdown feature.
Whats needed are settings to turn these UI elements, plus the status bar, off entirely (as in, not visible) and back on again. Like the command line options but something that works at runtime and can be toggled on or off based on user preference without having to restart their session.