### 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
for (const Ref<Theme> &theme : global_context->get_themes()) {
		if (theme.is_null()) {
			continue;
		}
		for (const StringName &E : theme_types) {
			if (!theme->has_font(theme_name, E)) {
				continue;
			}
			Ref<Font> f = theme->get_font(theme_name, E);
			if (f == this) {
				continue;
			}
			if (f.is_valid()) {
				theme_font = f;
				theme_font->connect_changed(callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids), CONNECT_REFERENCE_COUNTED);
			}
			return f;
		}
	}
	Ref<Font> f = global_context->get_fallback_theme()->get_font(theme_name, StringName());
	if (f != this) {
		if (f.is_valid()) {
			theme_font = f;
			theme_font->connect_changed(callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids), CONNECT_REFERENCE_COUNTED);
		}
		return f;
	}
	return Ref<Font>();
}
void FontVariation::set_variation_opentype(const Dictionary &p_coords) {