getCleanedShadowDom = el => {
  /* istanbul ignore next */
  if (window.ShadyCSS && window.ShadyCSS.nativeShadow === false) {
    const tagName = el.tagName.toLowerCase();
    const regexTagName = new RegExp(tagName, 'g');
    let domString = el.shadowRoot.innerHTML;
    domString = domString.replace(/style-scope/g, ''); // remove style-scope class
    domString = domString.replace(regexTagName, ''); // remove scoped class name
    domString = domString.replace(/(class=".*?)(\s)*"/g, '$1"'); // remove trailing spaces in class=" "
    domString = domString.replace(/ class="\w?"/g, ''); // remove empty class attributes
    return domString;
  }
  return el.shadowRoot.innerHTML;
}
For comparison we do not need the style scoping classes on polyfilled browsers
Rather naive approach for now - probably need to improve once we have failing cases.

@param {Element} el Element you want to get the cleaned shadow dom
@returns {String} cleaned shadow dom