If you want the highest muzzle velocity, you have to use light-gas guns. However, they have drawbacks: they are bulkier, more complex and thus more expensive, and potentially more fragile.
The basic principle for maximum muzzle velocity is similar to rocket exhaust velocity: the fundamental limitation is the speed of sound in the expanding material. Hotter materials have higher limits, as do lighter molar masses (lighter molecules). Adding enough heat to make a difference would be impractical, at least for most conventional gun-like weapons, so you have to search for lighter combustion products. And the lightest ones are from gaseous (at room temperature) reactants - hence the name.
At this point, you can look at chemical rocket fuels as constraints are the same, and for the same reasons. Hydrogen/oxygen is the best, but hydrogen is atrociously bulky, stupidly cold, tends to escape any container, weaken metals and is generally not worth it. If you are OK with cryogenically stored fuels, methane-oxygen or ethylene-oxygen is a good compromise. In general, look at chemical rocket fuels, look for specific impulse (Isp) which is proportional to exhaust velocity and search for the compromise you want between practicality and efficiency.
Now, if you want much higher velocities than that, you can use a piston light-gas gun. The entire gun apparatus is essentially single-use and they fire small projectiles, so you won't be able to carry many, but you can reach more than 10 km/s. They may have their uses.
Theoretically, you could use a detonation gun based on the principles of the pulse detonation engine - as with the engine, detonation allows you to reach a faster exhaust/muzzle velocity than with déflagration. However, I am not aware of any firearm using this principle, and there may be significant problems with the concept.
A way to extend range and possibly have a supersonic (or even hypersonic) projectile without a giant, complex cannon is to put a ramjet or (let's be crazy) scramjet on your projectile, assuming advanced mass-production techniques allow you to do so at reasonable prices. The cannon accelerates the projectile enough for the sc/ramjet to start being effective, and the projectile itself accelerates further, and continue to do so for some of the flight duration. Use solid fuel ignited when firing to have an entirely passive, no-moving-parts motor.
(An alternative to chemical combustion is electrically flash-heating the propellant, similarly to an arcjet It is currently studied for tank cannons, though I couldn't find the source at the moment)
(Also, theoretically, the most powerful chemical explosive/propellant would be metallic hydrogen, but this is still very hypothetical.)