After Synap did the work of finding the table
these are my comments:
"Safe" wire sizes are those that won't burn under specified current load. That current is lower for cables (bundled wires) than for single wires. The entire subject of safety is covered by the National electric Code and includes fusing, etc.
But when one designs for minimizing voltage drop, the game changes because voltage drop can be a tougher constraint if the voltage is low to begin with. (12VDC is LOW.) Or hundreds of feet to a submersible pump is subject to the same considerations...
From Table: AWG10 has 1 Ohm/1000ft or 1 Milliohm/ft
At 40 Amps, you get 40 mV drop / ft
Double for TO and FROM.
Assume distance between inverter and battery = 10 feet.
double for wire length = 20 feet
drop at 40 A = 800 Millivolts ( .8 Volts)
If inverter trip-out is at 10.5 V (normal value), it will trip out with battery still at 10.5 + 0.8 = 11.3 Volts.
It is basically up to you if that is acceptable or not.
But inverter trip-outs on starting currents are a pain!
Of course, if you double up AWG 10 you cut the drop in half. That is sometimes preferrable to the use of heavier wire.
At 40 Amps you also run into fuse (size) problems.
I would use automotive CBs instead of a fuse.
----------------------------------------------------------
The point is that with a long DC run between battery and inverter you can limit unduly what you can take out of a battery.
Also that is why really big inverters are often sized for 24 or 48 Volt systems.