Which manual transmission is best, 3, 4, 5, or 6 speed?

No it isn’t. Not all 5th gears are overdrive, not all 4th gears are 1:1. If the trans HAS 6 gears, it isn’t a 4 speed, its a 6 speed.

What matters is the total spread between 1st and the last gear.

My 2007 Mustang 5 speed with its 4.6L V8 had a 3.55 final drive:
1st 3.38:1 or 12:1 engine to wheels
4th 1:1
5th 0.68:1 or 2.41 engine to wheels
1st divided by 5th is 4.97:1 total gear spread

My 2013 automatic with its 5.0L V8 has a 3.15 final drive
1st is 4.47:1 or 13.1 engine to wheels
4th is 1.14:1
5th is 0.86:1
6th is 0.69:1 or 2.17 engine to wheels
1st divided by 6th is 6.47 total gear spread

So that extra gear gives me a harder launch off the line and a lower rpm at highway speeds. Quicker acceleration and more economical.

The 5 speed could have had the same spread between 1st and 5th but the rpm drop between gears would be too large.

The optimum situation for acceleration is usually when a shift at redline drops the rpm to a mathematically similar torque point. Much like this for the 6 speed automatic (the 6th gear curve omitted) speed:

Looks like there needs to be a 7th gear between 1st and second…but the torque converter fills that gap. The 5 speed could have given me a larger rpm drop between shifts with the ratios but I’d either lose some acceleration in 1st or MPGs in 5th. The choice of transmission ratios must go hand in hand with the final drive and the engine’s torque curve.