### 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
return p_string.to_upper();
}
String TextServerFallback::_string_to_lower(const String &p_string, const String &p_language) const {
	return p_string.to_lower();
}
PackedInt32Array TextServerFallback::_string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const {
	PackedInt32Array ret;
	int line_start = 0;
	int line_end = 0; 
	int word_start = 0; 
	int word_length = 0;
	for (int i = 0; i < p_string.length(); i++) {
		const char32_t c = p_string[i];
		if (is_linebreak(c)) {
			
			ret.push_back(line_start);
			ret.push_back(i);
			line_start = i + 1;
			line_end = line_start;
			word_start = line_start;
			word_length = 0;
		} else if (c == 0xfffc) {
			continue;
		} else if ((is_punct(c) && c != 0x005F) || is_underscore(c) || c == '\t' || is_whitespace(c)) {
			
			if (word_length > 0) {
				line_end = i - 1;