### Godot version

4.0 beta 12 mono

### System information

MacOS 13.1, Apple M1 Pro

### Issue description

When `text_editor/external/use_external_editor` is set to true but `text_editor/external/exec_path` is not set and I create a new script and attach it to a node Godot freezes and i need to force quit the application.
Also after a restart when double clicking on the script the application freezes but I can quit normally

### Steps to reproduce

- Set Use External Editor to true in Editor Settings and leave Exec Path empty
- Create a new project with Moblie Renderer and Git Versioning in Godot
- Create a 3D Scene
- Create a gd script in the FileSystem inspector or directly attach the script to a node

### Minimal reproduction project

[New Game Project.zip](https://github.com/godotengine/godot/files/10420510/New.Game.Project.zip)

file_menu->get_popup()->add_separator();
	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/run_file", TTR("Run"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::X), FILE_RUN);
	file_menu->get_popup()->add_separator();
	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KeyModifierMask::CMD_OR_CTRL | Key::BACKSLASH), TOGGLE_SCRIPTS_PANEL);
	file_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option));
	file_menu->get_popup()->connect("about_to_popup", callable_mp(this, &ScriptEditor::_prepare_file_menu));
	script_search_menu = memnew(MenuButton);
	script_search_menu->set_text(TTR("Search"));
	script_search_menu->set_switch_on_hover(true);
	script_search_menu->set_shortcut_context(this);
	script_search_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option));
	menu_hb->add_child(script_search_menu);
	MenuButton *debug_menu_btn = memnew(MenuButton);
	menu_hb->add_child(debug_menu_btn);
	debug_menu_btn->hide(); 
	EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton();
	debugger->set_script_debug_button(debug_menu_btn);
	debugger->connect("goto_script_line", callable_mp(this, &ScriptEditor::_goto_script_line));
	debugger->connect("set_execution", callable_mp(this, &ScriptEditor::_set_execution));
	debugger->connect("clear_execution", callable_mp(this, &ScriptEditor::_clear_execution));
	debugger->connect("breaked", callable_mp(this, &ScriptEditor::_breaked));
	debugger->get_default_debugger()->connect("set_breakpoint", callable_mp(this, &ScriptEditor::_set_breakpoint));
	debugger->get_default_debugger()->connect("clear_breakpoints", callable_mp(this, &ScriptEditor::_clear_breakpoints));
	menu_hb->add_spacer();
	script_icon = memnew(TextureRect);
	menu_hb->add_child(script_icon);
	script_name_label = memnew(Label);
	menu_hb->add_child(script_name_label);
	script_icon->hide();
	script_name_label->hide();