### 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
continue;
		}
		
		int best_score = 0;
		for (int i = 0; i < file->get_face_count(); i++) {
			file->set_face_index(0, i);
			BitField<TextServer::FontStyle> style = file->get_font_style();
			int font_weight = file->get_font_weight();
			int font_stretch = file->get_font_stretch();
			int score = (20 - Math::abs(font_weight - weight) / 50);
			score += (20 - Math::abs(font_stretch - stretch) / 10);
			if (bool(style & TextServer::FONT_ITALIC) == italic) {
				score += 30;
			}
			if (score > best_score) {
				face_indeces.clear();
			}
			if (score >= best_score) {
				best_score = score;
				face_indeces.push_back(i);
			}
		}
		if (face_indeces.is_empty()) {
			face_indeces.push_back(0);
		}
		file->set_face_index(0, face_indeces[0]);
		
		if (best_score != 50) {
			Dictionary ftr = file->get_supported_variation_list();
			if (ftr.has(TS->name_to_tag("width"))) {