Here is our solution to add markup to the view title:
function my_module_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) {
$output['#post_render'][] = function ($content, array &$element) {
$element['#title']['#markup'] = 'test - <b>My<em>My new Title</b>';em>';
return $content;
};
}
Tested on Drupal 10.2.7.