Microbial metabolic networks perform the basic function of harvesting energy from nutrients to generate the work and free energy required for survival, growth and replication. The robust physiological outcomes they generate across vastly different organisms in spite of major environmental and genetic differences represent an especially remarkable trait. Most notably, it suggests that metabolic activity in bacteria may follow universal principles, the search for which is a long-standing issue. Most theoretical approaches to modeling metabolism assume that cells optimize specific evolutionarily-motivated objective functions (like their growth rate) under general physico-chemical or regulatory constraints. While conceptually and practically useful in many situations, the idea that certain objectives are optimized is hard to validate in data. Moreover, it is not clear how optimality can be reconciled with the degree of single-cell variability observed within microbial populations. To shed light on these issues, we propose here an inverse modeling framework that connects fitness to variability through the Maximum-Entropy guided inference of metabolic flux distributions from data. While no clear optimization emerges, we find that, as the medium gets richer, Escherichia coli populations slowly approach the theoretically optimal performance defined by minimal reduction of phenotypic variability at given mean growth rate. Inferred flux distributions provide multiple biological insights, including on metabolic reactions that are experimentally inaccessible. These results suggest that bacterial metabolism is crucially shaped by a population-level trade-off between fitness and cell-to-cell heterogeneity.