Robust Statistical Inference Through the Lens of Optimization