To design a long range fighter in 1939/40 you must predict that they are needed, you must see the speed and economy of the Mustang before it is built and you must have available merlin engines that were produced in 1944. The mustang was a great design by a small manufacturer and had a charmed or even fated existence. Few saw the need of a long distance escort and even fewer saw the Mustang as that aeroplane. If the merlin did not slot in readily where the Allison had been it would never have happened.
Or to just not ignore designs with potential for such a role ... or fail to emphasize development of them for longer range. Granted, that even goes as far as shorter range aircraft (and pretty much all aircraft) lacking drop-tank support early on.
From the 1939/1940 standpoint, there were many fighters in development or even in service that could have developed into a long-range role. In England you had Gloster's F.9/37 twin engine fighter that had plenty of potential for the multirole/long-range fighter category, and possibly derivatives of a single-seat Defiant as well.
The US had the P-38, P-47, and F4U in development, all of which could have had more emphasis put on escort capabilities. Though none would have been really combat ready for 1941. (plus the P-38 had a whole list of problems, P-47 took a while to get large enough pressurized drop tanks and/or wing pylons, and the Corsair wasn't being persued for the USAAF) Hypothetically though, the F4U seems like it might have been the erliest really practical escort fighter for the US. Accelerate development without Naval specific requirements and it might have entered service sooner. Good medium altitude performance, decent high alt (especially compared to contemporaries) good enough for US high alt bomber alts, and certainly at British bomber heights. (not P-47 turbo level power ceiling, but also lighter and more maeuverable)
There's an argument for the F4U making a better fighter-bomber than the P-47 too, but that's not pertanent here.
Germany had the likes of the Fw-187 on their hands too, though with most bombing ranges they worked with, drop-tank capable Bf-109s would have been good enough.
And, of course, Japan had heavy empahsis on exceptional long range capabilities pre-war, though achieved that in part by emphasizing lightweight construction, no self-sealing tanks, and no armor on top of large fuel capacity and fuel efficient engines.
On that note, the F2A Buffalo might have actually fit in reasonably well as a long-range fighter. Certainly the only pre-way US/British/German fighter in service witha range exceeding 1000 miles, let alone 1500. (technically, the P-40B could manage >1000 miles at minimum cruise, but that was slightly later and not in the same range class as the Buffalo)
The problem being that the performance was a bit mediocre ... manufacturing issues aside, between the lower rated refurbished engines on the Export models the British worked with and the heavier F2A-3, they'd have been ill suited to escorting bombers over Europe by the time the allies moved on to large scale offenssive raids.
That said, in the 1939/1940 context, it was probably the only thing remotely close to a serviceable single-engine escort fighters that the allies had, and performance wasn't far off from a similar vintage Hurricane. (and similarly up-armmed and armored, and more maneuverable -especially roll rate- along with lacking negative G fuel flow issues)
The F4F-3 with drop tanks might have been useful in this role too. (could go from F2A+F4F early war to F4U once it comes online)
Perhaps a P-40 derivative with cowl guns retained and wing guns reduced or elliminated in favor of more fuel would have been a useful early-war stop-gap too? (2x synchronized .50s is a bit weak, but strictly against other fighters it might have been marginally acceptable when nothing else could manage the range) That's assuming the gun bays were useful for holding fuel cells. (or that engineering space for wing tanks wouldn't be more difficult than the space for 6x .50s in the P-40D)
But really, once the Corsair hit the scene, that plane alone (in sufficient numbers) seems like it could have adapted to pretty much every role Allied fighters/fighter-bombers were called upon for in the ETO/MTO ... maybe not the super long-range capabilities of the P-38J/L exploited in the PTO, at least not without further expanded fuel. (perhaps a P-47N style wing redesign) Well that or some specific capabilities of the Beaufighter and especially Mossie.
A massive amount of luck resulted in a plane that could hardly be designed better for a job it was never actually designed for. It was so good that it is now easy to say the Brits were remiss in not designing one sooner but the Spitfire was designed around a 850HP engine, how would a Mustang/P51 perform with only 850HP?
The P-40 was adapted from the P-36 initially working with considerably weaker engines than the Merlin, yet expanded into a significantly longer-range aircraft than the Spitfire in spite of being closer to the Hurricane in original engineering date. (and flying slightly earlier)
I suppose that luck argument could apply to the P-36/P-40 too, though, given how well it developed ... and given Crutis's own difficulties in actually engineering something more capable than the existing airframe worked out to be.