Living systems maintain or increase local order by working against the second law of thermodynamics. Thermodynamic consistency is restored as they consume free energy, thereby increasing the net entropy of their environment. Recently introduced estimators for the entropy production rate have provided major insights into the efficiency of important cellular processes. In experiments, however, many degrees of freedom typically remain hidden to the observer, and, in these cases, existing methods are not optimal. Here, by reformulating the problem within an optimization framework, we are able to infer improved bounds on the rate of entropy production from partial measurements of biological systems. Our approach yields provably optimal estimates given certain measurable transition statistics. In contrast to prevailing methods, the improved estimator reveals nonzero entropy production rates even when nonequilibrium processes appear time symmetric and therefore may pretend to obey detailed balance. We demonstrate the broad applicability of this framework by providing improved bounds on the energy consumption rates in a diverse range of biological systems including bacterial flagella motors, growing microtubules, and calcium oscillations within human embryonic kidney cells.