### Godot version

8449592d92eaeef990f5502b419d491ee3eeb7a6

### System information

Windows 11

### Issue description

Zooming in the script editor on an empty script freezes the entire editor for a few seconds, but if the file is large then it freezes for 4-5 seconds (which is unacceptable). Looks like a recent regression.

### Steps to reproduce

Just zoom in/out on the large script file.

### Minimal reproduction project

N/A
if (base_font.is_valid()) {
		base_font->disconnect_changed(callable_mp(reinterpret_cast<Font *>(this), &Font::_invalidate_rids));
		base_font.unref();
	}
	face_indeces.clear();
	ftr_weight = 0;
	ftr_stretch = 0;
	ftr_italic = 0;
	for (const String &E : names) {
		if (E.is_empty()) {
			continue;
		}
		String path = OS::get_singleton()->get_system_font_path(E, weight, stretch, italic);
		if (path.is_empty()) {
			continue;
		}
		Ref<FontFile> file;
		file.instantiate();
		Error err = file->load_dynamic_font(path);
		if (err != OK) {