### Godot version

4.1 

### System information

Win 10

### Issue description

![image](https://github.com/godotengine/godot/assets/3350340/fb4d82dc-0301-46d4-85e8-032c32b09fcf)

When causing _"output oveflow"_ by printing a lot of text, formating breaks. Possible because enclosing tag get flushed.

Suggested solution: clear text formating after _output oveflow_ warning.

### Steps to reproduce

Print a lot of text with different text tags (like [color] or [bgcolor]) to console. For example in _process function.

### Minimal reproduction project

N/A
return custom_effects;
}
void RichTextLabel::install_effect(const Variant effect) {
	Ref<RichTextEffect> rteffect;
	rteffect = effect;
	ERR_FAIL_COND_MSG(rteffect.is_null(), "Invalid RichTextEffect resource.");
	custom_effects.push_back(effect);
	if ((!text.is_empty()) && use_bbcode) {
		parse_bbcode(atr(text));
	}
}
int RichTextLabel::get_content_height() const {
	const_cast<RichTextLabel *>(this)->_validate_line_caches();
	int total_height = 0;
	int to_line = main->first_invalid_line.load();
	if (to_line) {
		MutexLock lock(main->lines[to_line - 1].text_buf->get_mutex());
		if (theme_cache.line_separation < 0) {
			
			total_height = main->lines[to_line - 1].offset.y + main->lines[to_line - 1].text_buf->get_size().y + (main->lines[to_line - 1].text_buf->get_line_count() - 1) * theme_cache.line_separation;
		} else {
			total_height = main->lines[to_line - 1].offset.y + main->lines[to_line - 1].text_buf->get_size().y + main->lines[to_line - 1].text_buf->get_line_count() * theme_cache.line_separation;
		}
	}
	return total_height;
}
int RichTextLabel::get_content_width() const {