Thanks for that. I did some research and came back with an update.
Properly escaped code (CSS or JS) wrapped in a div with a class of .w-embed.w-script makes the roundtrip when posted via the API and then when exported as a CSV. It displays on the front-end. The embed element is not accessible in the designer for edits.
Interestingly, you can put images and other html with classes into the body of a rich-text field. Will render just fine on front end. The URL’s on images are not touched and are visible and editable as images in the designer (standard image dialog).
I even added webP image sources into a RTF and a layout with CSS grid and that worked. This opens some real possibilities! I am no longer constrained! Now forget about editing this content in the designer or editor but if you have a remote DB and use the API you could theoretically do what you want. BOOM.
Here is a front-end demo of a collection item RTF populated with code (dynamic images in a CSS grid, most are WebP) on the front end.
Here is a backend CMS Item shot. Note that the grid is not being implemented since that is invoked with custom code which does not show in the designer in this case.
Here is a patch done from postman for the curious.