Advancements in wearable robots aim to improve user motion, motor control, and overall experience by minimizing energetic cost (EC). However, EC is challenging to measure and it is typically indirectly estimated through respiratory gas analysis. This study introduces a novel EMG-based objective function that captures individuals’ natural energetic expenditure during walking. The objective function combines information from electromyography (EMG) variables such as intensity and muscle synergies. First, we demonstrate the similarity of the proposed objective function, calculated offline, to the EC during walking. Second, we minimize and validate the EMG-based objective function using an online Bayesian optimization algorithm. The walking step frequency is chosen as the parameter to optimize in both offline and online approaches in order to simplify experiments and facilitate comparisons with related research. Compared to existing studies that use EC as the objective function, results demonstrated that the optimization of the presented objective function reduced the number of iterations and, when compared with gradient descent optimization strategies, also reduced convergence time. Moreover, the algorithm effectively converges toward an optimal step frequency near the user’s preferred frequency, positively influencing EC reduction. The good correlation between the estimated objective function and measured EC highlights its consistency and reliability. Thus, the proposed objective function could potentially optimize lower limb exoskeleton assistance and improve user performance and human–robot interaction without the need for challenging respiratory gas measurements.