It is not advisable to use regular power cord and add the plug to it for outdoor use, as it will not be water resistant
I doubt I ever have that many machines I would use outdoors. Too much risk of abuse and theft. I wouldn't use a add-on plug either way. I've seen them, and I don't think they're very robust, especially if I tried to put one together.
Your original idea of cutting an extension cord was ok but like the Pilot said, needless extra connections.
I don't suppose it really adds much to a machine that is meant to remain in place for years. Wiring a stub cord with male plug would probably be the most useful if the machine is handled in ways that increase the chance of the cord being damaged. Like if it is moved around a lot, or left where rats can get at the wiring. Though a stub cord won't help much if rats chew on more than just the power cord.
After installing a power cord, always clamp a section of it to the compressor base to absorb the strain of a hard pull against your connections.
If a stub cord is used, it should be long enough to have strain relief like described above, shouldn't it?