This paper proposes an efficient penalty function method to transform constrained optimization problems into unconstrained ones without introducing Lagrange multipliers or slack variables. The method designs new activation and loss penalty functions for inequality and equality functional models and establishes a non-Lagrangian-constrained optimization method. A novel optimality condition independent of any additional variables and equivalent to the Karush–Kuhn–Tucker (KKT) condition is introduced. Additionally, a scenario constraint handling method that does not rely on slack variables is proposed. Compared to soft constraint optimization methods, the proposed method can easily handle numerous scenario constraints. Two examples are used to compare the results with those in the literature, verifying the effectiveness and reliability of the proposed method. Finally, the method is applied to three scenario-based uncertainty quantification problems, including a trigonometric function affected by a noise term, the dynamic performance of a black-box system controller, and the frequency response of a damaged suspension arm. The results demonstrate that the proposed penalty function method can effectively solve scenario-based uncertainty quantification problems with many constraints and improve computational efficiency, providing a new method and means for addressing uncertainty quantification optimization problems in engineering.