We are using the approach Marijn described for foreign HTML content.
We have a special node which has an attribute that contains an arbitrary HTML string. This node type does not allow children in the PM document. We then have a node view which makes a few adjustments to the HTML string before rendering it inside the nodeview
dom element. The nodeview has logic to avoid re-parsing and re-rendering the HTML content unless strictly necessary.
There’s a bunch more you can do with it too, but that approach has worked well for us so far and allows for further extension. For example, we have a command which converts the node and its HTML content into a simplified form that maps nicely to nodes in our ProseMirror document schema.