You are really stuck on the idea that paint is an insulator. The majority of paints today are made with titanium dioxide and chemical organic colorants. Latex and acrylic paints are to be avoided, mostly for their lack of resilience against impact. And wouldn't you know it, excepting the occasional annodization of aluminum (a colored hardening layer) most heatsinks on memory are already painted.
The "heatsinks" on memory don't do a whole lot except act as a place for some design. Unless you are heavily overvolting the whole idea behind DDR4 was a lower power envelope than DDR3L. You don't often see heatsinks on SODIMM memory, and that has twice the density typically, and they live in environments with no airflow at all.
Highly overclocked DDR2 was really the last memory that truly needed heat spreaders. Prior to that you had RAMBUS, pretty much all other off the shelf memory was sold bare. 'Premium' memory like Corsair XMS2 also had heatspreaders and not heatsinks.
So many examples out there of memory and GPUs, even motherboards, being painted with no ill effects.