In today’s investment landscape, the integration of environmental, social, and governance (ESG) factors with data-driven strategies is pivotal. This study delves into this fusion, employing sophisticated statistical techniques and Python programming to unveil insights often overlooked by traditional approaches. By analyzing extensive datasets, including S&P500 financial indicators from 2012 to 2021 and 2021 ESG metrics, investors can enhance portfolio performance. Emphasizing ESG integration for sustainable investing, the study underscores the potential for alpha generation. Time series analysis further elucidates market dynamics, empowering investors to align with both financial objectives and ethical values. Notably, the research uncovers a positive correlation between ESG risk and total risk, suggesting that companies with lower ESG risk tend to outperform those with higher ESG risk. Moreover, employing a long–short ESG risk strategy yields abnormal returns of approximately 4.37%. This integration of ESG factors not only mitigates risks associated with environmental, social, and governance issues but also capitalizes on opportunities for sustainable growth, fostering responsible investing practices and ensuring long-term financial returns, resilience, and value creation.