That is referred to as a double pole 40A breaker, by the way. And yes, that 8 gauge would be fine for a 40A circuit. You do have two options:
1. You could put a wall connector on it, and I think that would probably reach well enough, since the Gen3 wall connector has the wire connections right there on a back plate that is mounted on the wall, so it's very close.
2. Instead of a wall connector, you could put an outlet on that instead. Since there is not an outlet type specific to a 40A circuit, electric code does allow for 50A outlet types on 40A circuits. So with three conductors plus ground, you could put on a 14-50 outlet. (You would need to order the 14-50 adapter from Tesla) The charging cord that comes with the car will only draw 32A maximum, which is the proper level for a 40A circuit (can only draw 80% of the circuit rating).
Electric code does have one other irritating requirement about the outlet options though. It says that any outlet being installed for the purpose of electric car charging must use a GFCI breaker, which are annoyingly about $100. Wall connectors don't need that. So weigh your cost options, which are basically either $500 for the wall connector or $45 for the 14-50 adapter + $100 for the GFCI breaker.