Paint on stranded copper wire twisted together with a wire nut -- dangerous?
Paint can act as an insulator so is it a hazard not normally. Wire nuts cut into the wire slightly so the nut itself makes contact if nothing else.
Best practice would be to use a bit of sandpaper or scotch brite to clean the paint off and provide a better connection.
In motors the red varnish is really thin. A 3m rep showed how well scotchlocks (there wire nut brand) did in creating good contact with varnished wires (sales pitch) but in my experience all the brands do about the same as long as they have the metal.
So scrape the paint for best results, tighten the nut until the wires twist below the nut according to the brand you like instructions.