Photovoltaic (PV) systems are integral to renewable energy, demanding accurate performance modeling for optimal functionality. This paper presents a pragmatic, data-driven approach employing Polynomial Regression (PR) for solar panel modeling to boost accuracy and adaptability to environmental variables. By emphasizing the advantages of data-driven models in attaining predictive precision, this study aims to reconcile theoretical concepts with practical solar panel performance. PR is employed as a black-box machine learning (ML) algorithm to transcend the limitations of traditional modeling methods, revealing ML's ability to grasp intricate relationships and ensure precise predictions. Utilizing real and simulated datasets encompassing solar irradiance, ambient temperature, and applied load through hardware in the loop (HIL), the model is trained to forecast the electrical outputs of solar panels in two approaches to estimate output voltage and current as well as key points on the panels' I-V curve. Assessment of model accuracy using Root Mean Square Error (RMSE) showcases the PR model's capacity to accurately depict solar panel performance by capturing non-linear relationships between environmental variable conditions and electrical outputs. Experimentation validates the method's effectiveness, focusing on accuracy, generalization to testing, and on-site data validation in two approaches. This research endeavors to bridge the gap between theory and practice, propelling advancements in the field of solar PV systems and facilitating more efficient solar energy utilization.