Ooh, I don’t often get to gush about this stuff, so forgive me if I excitedly overshare a bit…
Like Chronos, Wesley, and beowulff have already said, the energy payback time on PV is really short these days, like 4 years or less. (The financial payback time is also great, often less than 7 years or so).
Another way of looking at it is EROEI: energy return on energy invested, or how many times more energy the system will make through its expected lifetime than it took to manufacture it. Solar isn’t great in this regard, but it doesn’t necessarily matter because its fuel source (the sun) is relatively unlimited and clean vs fossil fuels that take thousands of years to replenish, and produces a lot of pollution once you do unleash all that energy (by burning them).
This sort of thing in general is called a lifecycle analysis, and they’re a critical part of shaping energy policy (well, for sane administrations). They range from incredibly complex to horrifyingly byzantine, depending on where you set the system boundaries (do you count the factories that build the vehicles that mine silica? do you count the e-waste that gets shipped to China and then dumped into rivers?).
It’s also useful for looking at climate change impacts, as measured by greenhouse gas emissions per kilowatt-hour (normalized to CO2). It’s in that sense that renewables and nuclear are much cleaner than fossil fuels. However, these don’t take into account other non-climatic impacts on environment or human health, such as radiation/nuclear waste, large dams’ impacts on hydrological and human communities, the toxicity of mining/refining/producing different things, the difficulty of recycling/disposal, etc.
For example, one big problem with renewables is storage: how to store electricity generated during productive times so that it can still be used at night or when the wind isn’t blowing. Two common solutions are batteries (the Tesla model) or pumped hydro storage (using electricity to pump water into a reservoir, then slowly drain it back through a turbine when needed). Some solar generators, instead of using photovoltaics, use sunlight to directly heat/melt some fuel, like a molten salt, that can stay hot long after the sun is down (and continue generating power). You can also apply a lifecycle analysis to this problem: In one study, pumping water is more than 20x more efficient than using batteries. There are people trying to integrate storage into EROEI comparisons, but I’m not familiar with them.
Another problem is that electricity generation is only about 28% of US greenhouse gas emissions, so even if you went 100% solar, that’s less than a third of US energy use. The other 66% (transportation, industry, agriculture, etc.) can’t always use electricity directly, such as with electric cars also needing a power delivery infrastructure that isn’t completely there yet, or plastics that require some sort of petroleum feedstock, or synthesizing fertilizers.
There is no energy source that’s entirely pollution free, but using LCAs is a cool way of looking at these questions from a systems perspective, holistically and in context in apples-to-apples comparisons, instead of from single sensationalized (or outright falsified) headlines.