### 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
font_weight = dvar[wgth_tag].operator int();
						}
						if (dvar.has(wdth_tag)) {
							font_stretch = dvar[wdth_tag].operator int();
						}
						if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) {
							font_style.set_flag(TextServer::FONT_ITALIC);
						}
						String locale = (span.language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : span.language;
						PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, text, locale, String(), font_weight, font_stretch, font_style & TextServer::FONT_ITALIC);
#ifdef GDEXTENSION
						for (int fb = 0; fb < fallback_font_name.size(); fb++) {
							const String &E = fallback_font_name[fb];
#else
						for (const String &E : fallback_font_name) {
#endif
							SystemFontKey key = SystemFontKey(E, font_style & TextServer::FONT_ITALIC, font_weight, font_stretch, fdef, this);
							if (system_fonts.has(key)) {
								const SystemFontCache &sysf_cache = system_fonts[key];
								int best_score = 0;
								int best_match = -1;
								for (int face_idx = 0; face_idx < sysf_cache.var.size(); face_idx++) {
									const SystemFontCacheRec &F = sysf_cache.var[face_idx];
									if (unlikely(!_font_has_char(F.rid, text[0]))) {
										continue;
									}
									BitField<FontStyle> style = _font_get_style(F.rid);
									int weight = _font_get_weight(F.rid);
									int stretch = _font_get_stretch(F.rid);
									int score = (20 - Math::abs(weight - font_weight) / 50);