Is it OK to solder a power cord?
The insulation on the cable may not be specified for the soldering temperature, and may be damaged.

The insulation is selected for electrical isolation, flexibility and thermal properties.  These properties may change if the insulation is taken beyond the storage temperature limits.  Damaged insulation may be considered to be non-existent insulation.

The flexibility of the cable will be affected by the soldering, as solder typically wicks some distance up the copper.

The restraint of the cable inside the equipment is typically redundant; a cable gland or clamp, followed by a screw terminal clamp on the copper end.  The restraint design depends on the strength of the cable.

The strength of a copper conductor, stranded or solid, is reduced by soldering, as some of the diameter of the copper changes from copper to a copper tin alloy.

The current rating is also affected.

The gasses released by the insulation during soldering may be harmful to the person doing the work.

My opinion is that it is fine to solder directly, as long as the additional risks are compensated for in some way; derating, additional insulation, additional anchoring, and good airflow during soldering.