Removing old thermostat when replacing electric baseboard heaters
Your plan to connect the wires bypassing the old thermostats is a good one and it is code legal.

Make sure to turn the breaker(s) off and test to be sure both legs are off.  I have found some 240 volt units that the thermostat only opened one leg.

Make sure to use the proper size wirenut or insulated crimps for the size and type of wire.  If aluminum wire is installed, make sure to use deox / noalox or some other type of inhibitors and the connectors rated cu/al for the size wire.