Building a highly accurate model for solar cells and photovoltaic (PV) modules based on experimental data is becoming increasingly important for the simulation, evaluation, control, and optimization of PV systems. Powerful, accurate, and more robust optimization algorithms are needed to solve this problem. In this study, a new optimization approach based on the Levenberg–Marquardt algorithm (ImLM) is proposed to estimate the parameters of PV cells and modules and simulate their electrical behavior under all environmental conditions efficiently and accurately. To avoid the premature convergence of the Levenberg–Marquardt algorithm and the long computation time caused by a bad choice of initial values, we propose a new approach. This is a new reduced form leading to a nonlinear relationship of the series resistance and thus allowing to calculate the optimal initial values of the model parameters. Comparisons with other published methods show that the proposed approach gives not only a more accurate final solution but also a fast convergence speed and a better stability. Furthermore, tests on three PV modules of different technologies (multi-crystalline, thin film, and monocrystalline) reveal that the proposed algorithm performs well at different irradiations and temperatures. These results confirm that the ImLM approach is a valuable tool and can be an effective and efficient alternative for extracting PV model parameters and simulating PV module behavior under different conditions.