#10 wire cannot and will not carry 40 amps as the amp capacity of #10 wire or 10 AWG wire is only 35 amps.
#10 wire can only safely handle up to 35 amps and drawing more than 35 amps on a #10 wire can cause a fire as the wires insulation can heat up and melt.
For 40 amps you want a #8 wire or 8 AWG.
The size wire that you need for a 40 amp breaker is a size 8 AWG which is an 8 gauge wire.
8 AWG wire is the standard wire size for electrical circuits that are on a 40 amp circuit breaker.
The gauge number of a wire indicates its thickness, with lower numbers representing thicker wires that can carry more current.
10 AWG wires and 12 AWG wires are not suitable for 40-amp circuit breakers.
10 AWG and 12 AWG copper wires have 35 Amp and 25 Amp wire ampacity.
Using the 10 AWG or 12 AWG for a 40 Amp circuit is inherently wrong and might result in an electric accident.
A 20-amp 240-volt circuit calls for 12-gauge wire.
A 30-amp circuit calls for 10-gauge wire.
A 40-amp circuit calls for 8-gauge wire.
And a 50-amp circuit calls for 6-gauge wire.