### Godot version

4.1.rc.custom_build. c83f912bc

### System information

Ubuntu 22.04 CI

### Issue description

When executing
```
extends Node
func _process(delta):

	var temp_variable35241 = RichTextLabel.new()
	add_child(temp_variable35241)
	temp_variable35241.set_fit_content(true)
	temp_variable35241.parse_bbcode("3188932498")
	temp_variable35241.queue_free()
```
this code freeze project in CI for at least 60 seconds

### Steps to reproduce

Above

### Minimal reproduction project

N/A
ItemFrame *frame = static_cast<ItemFrame *>(E->get());
					int column = idx % col_count;
					offset.x += frame->padding.position.x;
					float yofs = frame->padding.position.y;
					float prev_h = 0;
					float row_baseline = 0.0;
					for (int i = 0; i < (int)frame->lines.size(); i++) {
						MutexLock sub_lock(frame->lines[i].text_buf->get_mutex());
						frame->lines[i].text_buf->set_width(table->columns[column].width);
						table->columns[column].width = MAX(table->columns[column].width, ceil(frame->lines[i].text_buf->get_size().x));
						frame->lines[i].offset.y = prev_h;
						float h = frame->lines[i].text_buf->get_size().y + (frame->lines[i].text_buf->get_line_count() - 1) * theme_cache.line_separation;
						if (i > 0) {
							h += theme_cache.line_separation;
						}
						if (frame->min_size_over.y > 0) {
							h = MAX(h, frame->min_size_over.y);
						}
						if (frame->max_size_over.y > 0) {
							h = MIN(h, frame->max_size_over.y);
						}
						yofs += h;
						prev_h = frame->lines[i].offset.y + frame->lines[i].text_buf->get_size().y + frame->lines[i].text_buf->get_line_count() * theme_cache.line_separation;
						frame->lines[i].offset += offset;
						row_baseline = MAX(row_baseline, frame->lines[i].text_buf->get_line_ascent(frame->lines[i].text_buf->get_line_count() - 1));
					}
					yofs += frame->padding.size.y;
					offset.x += table->columns[column].width + theme_cache.table_h_separation + frame->padding.size.x;
					row_height = MAX(yofs, row_height);