### Godot version

4.0.3 stable

### System information

Windows 10, i5 8600, RTX3060, 64 GB ram

### Issue description

In Godot 4, labels with lots of text cause scenes to load extremely slowly, both in the editor and in-game.

I measured a few game starts with different amounts of text in a label:

Text length | Game start time
-- | --
11323 | 2.33
22693 | 7.93
34064 | 19.69
45431 | 40.59

In Godot 3, the startup times for all test lengths was almost instantaneous.

The text I used was multiple copies of the license agreement for Google's [Roboto](https://fonts.google.com/specimen/Roboto) font. A "credits" page on a game could easily get well above this length.
Looking at a scatter plot with a best fit, it's pretty clearly increasing at around n^2:

![image](https://github.com/godotengine/godot/assets/8082633/6e2a9c41-f3fb-429d-acd3-288c24c6b744)

Results are the same whether I'm using the built-in font or a custom font, and results are similar across all renderers. Settings like text wrapping don't seem to affect it either.

### Steps to reproduce

Create a scene, add a label to that scene, and fill the label with a large amount of text. Try to launch the game and load that scene.

### Minimal reproduction project

[Godot3LargeLabel.zip](https://github.com/godotengine/godot/files/11521494/Godot3LargeLabel.zip)
[Godot4LargeLabel.zip](https://github.com/godotengine/godot/files/11521495/Godot4LargeLabel.zip)

bool skip = (trim_chars && glyphs[j].end > visible_chars) || (trim_glyphs_ltr && (processed_glyphs_ol >= visible_glyphs)) || (trim_glyphs_rtl && (processed_glyphs_ol < total_glyphs - visible_glyphs));
							
							if (!skip) {
								draw_glyph_outline(glyphs[j], ci, font_color, font_shadow_color, font_outline_color, shadow_outline_size, outline_size, offset, shadow_ofs);
							}
							processed_glyphs_ol++;
							offset.x += glyphs[j].advance;
						}
					}
					
					if (!rtl && ellipsis_pos >= 0) {
						for (int gl_idx = 0; gl_idx < ellipsis_gl_size; gl_idx++) {
							for (int j = 0; j < ellipsis_glyphs[gl_idx].repeat; j++) {
								bool skip = (trim_chars && ellipsis_glyphs[gl_idx].end > visible_chars) || (trim_glyphs_ltr && (processed_glyphs_ol >= visible_glyphs)) || (trim_glyphs_rtl && (processed_glyphs_ol < total_glyphs - visible_glyphs));
								
								if (!skip) {
									draw_glyph_outline(ellipsis_glyphs[gl_idx], ci, font_color, font_shadow_color, font_outline_color, shadow_outline_size, outline_size, offset, shadow_ofs);
								}
								processed_glyphs_ol++;
								offset.x += ellipsis_glyphs[gl_idx].advance;
							}
						}
					}
				}
				
				
				if (rtl && ellipsis_pos >= 0) {
					for (int gl_idx = ellipsis_gl_size - 1; gl_idx >= 0; gl_idx--) {
						for (int j = 0; j < ellipsis_glyphs[gl_idx].repeat; j++) {
							bool skip = (trim_chars && ellipsis_glyphs[gl_idx].end > visible_chars) || (trim_glyphs_ltr && (processed_glyphs >= visible_glyphs)) || (trim_glyphs_rtl && (processed_glyphs < total_glyphs - visible_glyphs));