### 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
ccpert("ccp_BD"));
		ccpert("ccp_IN"));
		ccp.digits = U"𑄶𑄷𑄸𑄹𑄺𑄻𑄼𑄽𑄾𑄿.";
		ccpsign = U"%";
		ccp.exp = U"e";
		num_systems.push_back(ccp);
	}
	// Adlam numerals.
	{
		NumSystemData ff;
		ffert("ff")); // Fulah
		ffert("ff_Adlm_BF"));
		ffert
		ffert("ff_Adlm_GH"));
		ffert("ff_Adlm_GM"));
		ffert("ff_Adlm_GN"));
		ffert("ff_Adlm_GW"));
		ffert("ff_Adlm_LR"));
		ffert("ff_Adlm_MR"));
		ffert("ff_Adlm_NE"));
		ffert("ff_Adlm_NG"));
		ffert("ff_Adlm_SL"));
		ffert("ff_Adlm_SN"));
		ff.digits = U"𞥐𞥑𞥒𞥓𞥔𞥕𞥖𞥗𞥘𞥙.";
		ffsign = U"%";
		ff.exp = U"e";
		num_systems.push_back(ff);
	}
}
String TextServerAdvanced::_format_number(const String &p_string, const String &p_language) const {