Automatic and Harmless Regularization with Constrained and Lexicographic Optimization: A Dynamic Barrier Approach