### Godot version

4.0.dev (ba9491f87)

### System information

Windows 11 Chrome 109.0.5414.75 (Official Build), iOS 16.2 Safari

### Issue description

When exporting a simple project for Web with any GDScript like following:
```gdscript
extends Control

```
will print the following error to the console:
```
USER ERROR: U_ILLEGAL_ARGUMENT_ERROR
   at: _is_confusable (modules\text_server_adv\text_server_adv.cpp:6151)
```

![image](https://user-images.githubusercontent.com/173001/214089154-d88f3f44-b670-41ec-9743-30627677968e.png)

For more complex project, following additional errors are showing:
```
USER ERROR: U_FILE_ACCESS_ERROR
   at: _spoof_check (modules\text_server_adv\text_server_adv.cpp:6174)
USER ERROR: U_ILLEGAL_ARGUMENT_ERROR
   at: _is_confusable (modules\text_server_adv\text_server_adv.cpp:6151)
```
When I've inserted `print_line(p_string)` at text_server_adv.cpp line 6172, following logs are collected:
![image](https://user-images.githubusercontent.com/173001/214091164-cb5af630-56d2-446e-b1c4-dc20066565d5.png)

It seems that the identifiers of *.gd files are printed to the console.


### Steps to reproduce

1. Open minimal reproduction project.
2. Exports to Web.
3. Open exported site with Chrome and open developer console.
4. Following error logs will be seen (reproduced): `USER ERROR: U_ILLEGAL_ARGUMENT_ERROR`

### Minimal reproduction project

[text_server_adv_error.zip](https://github.com/godotengine/godot/files/10481582/text_server_adv_error.zip)

RID fdef = p_fonts[0];
		if (_font_is_allow_system_fallback(fdef)) {
			String text = p_sd->text.substr(p_start, 1);
			String font_name = _font_get_name(fdef);
			BitField<FontStyle> font_style = _font_get_style(fdef);
			int font_weight = _font_get_weight(fdef);
			int font_stretch = _font_get_stretch(fdef);
			Dictionary dvar = _font_get_variation_coordinates(fdef);
			static int64_t wgth_tag = _name_to_tag("weight");
			static int64_t wdth_tag = _name_to_tag("width");
			static int64_t ital_tag = _name_to_tag("italic");
			if (dvar.has(wgth_tag)) {
				font_weight = dvar[wgth_tag].operator int();
			}
			if (dvar.has(wdth_tag)) {
				font_stretch = dvar[wdth_tag].operator int();
			}
			if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) {
				font_style.set_flag(TextServer::FONT_ITALIC);
			}
			char scr_buffer[5] = { 0, 0, 0, 0, 0 };
			hb_tag_to_string(hb_script_to_iso15924_tag(p_script), scr_buffer);
			String script_code = String(scr_buffer);
			String locale = (p_sd->spans[p_span].language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_sd->spans[p_span].language;
			PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, text, locale, script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC);
#ifdef GDEXTENSION
			for (int fb = 0; fb < fallback_font_name.size(); fb++) {
				const String &E = fallback_font_name[fb];
#else