### 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()) {
		return base_font->get_spacing(p_spacing);
	} else {
		return 0;
	}
}
RID SystemFont::find_variation(const Dictionary &p_variation_coordinates, int p_face_index, float p_strength, Transform2D p_transform, int p_spacing_top, int p_spacing_bottom, int p_spacing_space, int p_spacing_glyph) const {
	Ref<Font> f = _get_base_font_or_default();
	if (f.is_valid()) {
		Dictionary var = p_variation_coordinates;
		if (ftr_weight > 0 && !var.has(TS->name_to_tag("weight"))) {
			var[TS->name_to_tag("weight")] = ftr_weight;
		}
		if (ftr_stretch > 0 && !var.has(TS->name_to_tag("width"))) {
			var[TS->name_to_tag("width")] = ftr_stretch;
		}
		if (ftr_italic > 0 && !var.has(TS->name_to_tag("italic"))) {
			var[TS->name_to_tag("italic")] = ftr_italic;
		}
		if (!face_indeces.is_empty()) {
			int face_index = CLAMP(p_face_index, 0, face_indeces.size() - 1);
			return f->find_variation(var, face_indeces[face_index], p_strength, p_transform, p_spacing_top, p_spacing_bottom, p_spacing_space, p_spacing_glyph);
		} else {
			return f->find_variation(var, 0, p_strength, p_transform, p_spacing_top, p_spacing_bottom, p_spacing_space, p_spacing_glyph);
		}
	}
	return RID();
}
RID SystemFont::_get_rid() const {