### Godot version

v4.1.stable.official [970459615]

### System information

MacOS Big Sure 11.3

### Issue description

I got a bug report on my project and then did a deeper analysis to find the rootcause of Godot crashing on exit.
https://github.com/MikeSchulze/gdUnit4/issues/225

short story
- i removed all classes and resources step by step but still crashs at Godot exit
- finally i find out a simple print statement in the `func _exit_tree():` let the editor crash at exit.


### Steps to reproduce

Step one
- Create a new Project
- Create a new plugin over the editor provided plugin creation tool
- activate and exit ... works

Step two
- open the `plugin.gd` and add a print statement to `func _exit_tree():`

```
@tool
extends EditorPlugin


func _enter_tree():
	# Initialization of the plugin goes here.
	pass


func _exit_tree():
	prints("_exit_tree")
	# Clean-up of the plugin goes here.
	pass

```

- close/restart the editor is crashing at exit


### Minimal reproduction project

n/a
if (!distribution_version.is_empty()) {
		info.push_back(distribution_name + " " + distribution_version);
	} else {
		info.push_back(distribution_name);
	}
#ifdef LINUXBSD_ENABLED
	if (!display_server.is_empty()) {
		info.push_back(display_server);
	}
#endif 
	info.push_back(vformat("%s (%s)", driver_name, rendering_method));
	String graphics;
	if (!device_type_string.is_empty()) {
		graphics = device_type_string + " ";
	}
	graphics += rendering_device_name;
	if (video_adapter_driver_info.size() == 2) { 
		String vad_name = video_adapter_driver_info[0];
		String vad_version = video_adapter_driver_info[1]; 
		if (!vad_version.is_empty()) {
			graphics += vformat(" (%s; %s)", vad_name, vad_version);
		} else {
			graphics += vformat(" (%s)", vad_name);
		}
	}
	info.push_back(graphics);
	info.push_back(vformat("%s (%d Threads)", processor_name, processor_count));
	return String(" - ").join(info);
}
Ref<Texture2D> EditorNode::_file_dialog_get_icon(const String &p_path) {