CV_NOLUA can be bypassed using an alias
The renderer
convar (and no others at the moment) has the flag CV_NOLUA
, which is supposed to prevent the variable from being changed by Lua scripts. (I'm not sure of the reason, but I assume there is one.) This means the following Lua code will not work:
CV_BufInsertText(consoleplayer, 'renderer opengl')
This code, however, is able to bypass that and change the renderer anyway:
CV_BufInsertText(consoleplayer, 'alias asdf "renderer opengl"')
CV_BufInsertText(consoleplayer, 'asdf')