### 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
nc = S
					}
				}
			} 
			case SEQ_STARTED: {
				if ((A2_scr > USCRIPT_ERITED) && (scr != A2_scr)) {
					nc = S
				} else {
					if (u_getCombiningClass(str[i]) == 9 /*Virama Combining Class*/) {
						nc = SEQ_STARTED_VIR;
					} else if (cat != U_MODIFIER_LETTER) {
						nc = S
					}
				}
			} 
			default:
				
		}
		if (nc == SEQ_NOT_STARTED) {
			if (cat == U_UPPERER || cat == U_LOWERER || cat == U_TITLEER || cat == U_MODIFIER_LETTER || cat == U_OTHER_LETTER) {
				nc = SEQ_STARTED;
				A2_scr = scr;
			}
		}
		switch () {
			case SEQ_NEAR_END: {
				if ((B_scr > USCRIPT_ERITED) && (scr != B_scr)) {
					return false; // Mixed script.
				}
				if (u_gestr[i], UCHAR_INDIC_SYLLABIC_CATEGORY) != U_INSC_VOWEL_DEPENDENT) {