### 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
const  lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
	String res = p_string;
	for (int i = 0; i < num_systems.size(); i++) {
		if (num_systems[i].lang.has(lang)) {
			if (num_systems[i].digits.is_empty()) {
				return p_string;
			}
			res.replace(num_systems[i].exp, "e");
			char32_t *data = res.ptrw();
			for (int j = 0; j < res.length(); j++) {
				if (data[j] == num_systems[i].digits[10]) {
					data[j] = '.';
				} else {
					for (int k = 0; k < 10; k++) {
						if (data[j] == num_systems[i].digits[k]) {
							data[j] = 0x30 + k;
						}
					}
				}
			}
			
		}
	}
	return res;
}
String TextServerAdvanced::_percent_sign(const String &p_language) const {