Some food for thought, hope the pics come through, posting this from my phone.
Basically, I would not go smaller than 4awg, at 300 amp draw with 5 feet of cable, your looking at about a .750 volt drop at the starter. A 2awg wire drops that down to less than a .5volt drop.
There are a lot of other variables, but this is a good rule of thumb. Bigger is better, within reason.
IIRC, back in the day, anything under a 1.0 volt drop at the starter was perfectly acceptable.
As previously mentioned, get a good high temp insulation, silicone is nice, and put something on it to protect it further. NAPA sells a nice aluminized heat reflective wrap for such situations. We use it on top of our big 2200HP V12 Detroit engines to protect wired that are right up by the turbos. Works really well. Whatever size you get for the solenoid, it’s good practice to get the same size ground wire, and off possible attach it close to the starter. Run an additional smaller ground wire from the intake or cylinder head to the battery and chassis. This helps to keep the high current running through the starter circuit ground from inter fearing with other, smaller ground currents ( choke, coil ground, temp sensor ground etc). It’s not mandatory to run the extra grounds, as the starter is only on while cranking, but it is good practice.