CodeMirror uses the mode "null" internally (see line 3083) for this.  If we changed the default language to use `["null", "text/plain"]` then I think we could avoid all this special case code.