Running surfaces, be they sliding, rotating or oscillating are best not painted. Such surfaces frequently work with minimal clearances for smooth running so paint can take up some of that valuable clearance. The paint can either erode and mix with the oil to form a sludge that can lock up moving parts or it can come off in chunks and again seize up moving parts. I also do not paint mating surfaces as the thickness of the paint can affect the fit and can make dismantling very difficult. Mating surfaces are rubbed with steam oil before assembly.
Generally ferrous parts need painting to prevent them rusting however all running surfaces should be left bare. It is far easier to paint the parts individually with the running surfaces masked. I use an acid etching primer followed by coach enamel. The running surfaces should then be kept oil free by frequent oiling. It is also possible to blue the metal, which also helps to prevent rusting but it is not as effective as paint or regular oiling.
This refurbished 10V was painted as individual parts after masking all running faces and mating faces. The crosshead guide was masked with a paper tube and mating surfaces were masked with masking tape.

A couple of coats of etching primer followed by a coat of two part epoxy paint:

All running gear is left bare with the ferrous parts relying on oil to keep them rust free:

Interestingly the cylinder cover was blued and simply needed cleaning up:

At the end of the day there will always be bare metal components that require attention to prevent rust forming. I even polish cylinder covers and valve chest covers, which then need oil rubbing into them:
