That $77B that is now returned to shareholders can be spent on whatever those shareholders want. It isn't really Apple's money to begin with... kind of the issue with being a public company. Unless of course its shareholders would look at that investment as sound, which might be a stretch given Apple's lack of background in any of those fields (maybe carbon capture given they have a great understanding of their supply chain and could already be thinking of ways to reduce their energy impact)