### 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
e__STAR Valid end of sequence, reset.
				} else {
					return false; // Invalid end of sequence.
				}
			} 
			case SEQ_STARTED_VIR: {
				if ((B_scr > USCRIPT_ERITED) && (scr != B_scr)) {
					 = S
				} else {
					if (str[i] == 0x200D /*ZWJ*/) {
						 = SEQ_NEAR_END;
						continue;
					} else if (cat != U_MODIFIER_LETTER || u_getCombiningClass(str[i]
						 = S
					}
				}
			} 
			case SEQ_STARTED: {
				if ((B_scr > USCRIPT_ERITED) && (scr != B_scr)) {
					 = S
				} else {
					if (u_getCombiningClass(str[i]) == 9 /*Virama Combining Class*/) {
						 = SEQ_STARTED_VIR;
					} else if (cat != U_MODIFIER_LETTER) {
						 = S
					}
				}
			} 
			default: