@Bread, there is probably mathematical way to calculate best gearing according available horsepower and torque, I don't have it

"Stealing" base gears from real life car with approx same engine power and it's easy to start modifying it, there is several gear calculators on net (excel sheets) what you can use when targeting rpm drops to stay on best torque/hp range.
Drag racing circles have good information of that, also excel sheets what can give few tips on journey to perfect gear setup.
I said few years ago this, still same thought is valid.
Longer Final: good for long straight, bad for cornering(understeers), reasonable for car with a lots of torq, hard to recover if skidding on cornering and starts oversteer. Slightly slow on acceleration if too long or not sufficient amount of torq availabe.
Shorter Final: bad on long straight, good for cornering(if too short starts oversteer too easily), reasonable for car with low torq, easy to recover on skidding situations. Quick acceleration if enough grip.
Longest/shortest finals, bad for almost all situations 
Finding balance for cornering and straights is a key for our quest, but final gear is not only solution, finetuning gears and making different LSD for different transmission(inc.final) is important.
This comment is valid for normal race track racing, not for drag, on drag you can calculate and test one "Best" setup.
@Jouni, I have few things on mind when doing gearbox to be good everywhere,
1st gear short enough to leave grid on edge of grip, means skidding if throttle is smashed down at once.
2nd gear to suit hairpins, entry to exit
3rd gear long enough to go semi quick chicane, and short enough to be capable powersliding during those if traction is lost.
4th really quick turns/chicane and good pull when gathering speed.
5th straight gear, or really close, one starting gear when tuning starts, final gear gets first base value from this gear, engine have to have power to pull this gear till limiter easily.
6th gear optimised for maximum speed.
If car has only 5 speed box then I'll sacrifice 1st gear to close usage as it is in 2nd with 6 speed box.all dropping one down and fourth gear is close to straight.
Exceptions are really low power/torque and really high power/torque cars, ideology still same.
And yes this means playing with final gear to get desired gear ranges first to exist.