Paint is a great insulator of heat, which means your engine will run hotter when painted for any given load. At a certain point the paint will discolor then burn and flake off.
I don't paint ANY of the diecast on the engine, includes the cylinder head, backplate behind the flywheel, and the carb. I don't paint any of the cylinder fins on the block. I don't paint the cast iron oil pan. I don't use cast aluminum oil pans.
I powder coat engine tins with gloss black powder coat, and paint the non finned parts of the block with thinned gloss black enamel.
Everything gets painted black because it radiates heat better than any other color. Flat black is actually best but gloss black looks better and cleans better. The powder coating resists oil, gas, heat, and mechanical damage much better than liquid paint.
That all said, Kohler and IH both sprayed the engines with 483 Federal yellow and did very little masking and the engines ran for a long time in most cases.