### 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
} else if (kpk.y > 0xFF) {
						WARN_PRINT(vformat("Invalid BMFont OEM character %x (should be 0x00-0xFF).", kpk.x));
						kpk.y = 0x00;
					}
				}
				if (keys.has("amount")) {
					set_kerning(0, base_size, kpk, Vector2(keys["amount"].to_int(), 0));
				}
			}
			if (f->eof_reached()) {
				break;
			}
		}
	}
	set_font_name(font_name);
	set_font_style(st_flags);
	if (st_flags & TextServer::FONT_BOLD) {
		set_font_weight(700);
	}
	set_cache_ascent(0, base_size, ascent);
	set_cache_descent(0, base_size, height - ascent);
	return OK;
}
Error FontFile::load_dynamic_font(const String &p_path) {
	reset_state();
	Vector<uint8_t> font_data = FileAccess::get_file_as_bytes(p_path);
	set_data(font_data);
	return OK;
}
void FontFile::set_data_ptr(const uint8_t *p_data, size_t p_size) {