### 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 (kpk.y >= 0x80 && kpk.y <= 0xFF) {
								kpk.y = _oem_to_unicode[encoding][kpk.y - 0x80];
							} else if (kpk.y > 0xFF) {
								WARN_PRINT(vformat("Invalid BMFont OEM character %x (should be 0x00-0xFF).", kpk.y));
								kpk.y = 0x00;
							}
						}
						set_kerning(0, base_size, kpk, Vector2((int16_t)f->get_16(), 0));
					}
				} break;
				default: {
					ERR_FAIL_V_MSG(ERR_CANT_CREATE, RTR("Invalid BMFont block type."));
				} break;
			}
			f->seek(off + block_size);
			block_type = f->get_8();
			block_size = f->get_32();
		}
	} else {
		
		f->seek(0);
		bool unicode = false;
		uint8_t encoding = 9;
		while (true) {
			String line = f->get_line();
			int delimiter = line.find(" ");
			String type = line.substr(0, delimiter);
			int pos = delimiter + 1;
			HashMap<String, String> keys;