RegExp to EXCLUDE strip HTML (FOR SOMME) comments

Try slapping a negative lookahead before the comment match, eg

function remove_html_comments($content="") {
    return preg_replace('/(?!<!--\s*\/?mfunc\s*' . W3TC_DYNAMIC_SECURITY . ')<!--(.|\s)*?-->/', '', $content);
}