### 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 (dirty_rids) {
		_update_rids();
	}
	real_t ret = 0.f;
	for (int i = 0; i < rids.size(); i++) {
		ret = MAX(ret, TS->font_get_underline_thickness(rids[i], p_font_size));
	}
	return ret;
}
String Font::get_font_name() const {
	return TS->font_get_name(_get_rid());
}
Dictionary Font::get_ot_name_strings() const {
	return TS->font_get_ot_name_strings(_get_rid());
}
String Font::get_font_style_name() const {
	return TS->font_get_style_name(_get_rid());
}
BitField<TextServer::FontStyle> Font::get_font_style() const {
	return TS->font_get_style(_get_rid());
}
int Font::get_font_weight() const {
	return TS->font_get_weight(_get_rid());
}
int Font::get_font_stretch() const {