This is like the reverse of lap-time simulation (e.g. OptimumLap or the serious $$$$ pro-level software): rather than "what is the fastest a car should be able to go on a given track?", we're trying to ask "what is the fastest track for a given car?".
Or something. The fundamentals are similar anyway. (I mean, at the extreme of the fundamentals, it's Newtonian physics...)
A while ago I dug up a bunch of info on lap time sim, and a few open-source or home-brew FSAE projects to copy, but I still have not made myself sit down and do anything with it.
A very old GRM thread
https://grassrootsmotorsports.com/forum/grm/free-track-simulation-software/16003/page2/
This thread exploded, didn't it.
And here my assumption wasn't "what's the fastest shape to travel one mile and return to the starting point" but rather "what's the fastest shape to go to a point a half mile away and back".
I imagine that the answer to the correct question will be a circle or something tri-lobed depending on how hard the car can accelerate at higher speeds vs how hard it can corner. The corners should be shaped so that corner entry uses cornering forces to slow the car, not braking... which would seem to imply a circle.
Another thing that implies a circle is that slowing down requires much more acceleration to make up for the lost speed, let alone surpassing it. Think of the riddle about driving a mile at 15mph, how fast would you have to drive a second mile to average 30mph over those two miles? (The answer is that it's impossible)