CI: Add ccache
Add Sccache https://github.com/mozilla/sccache to the GHA CI. Saves around 5 minutes per run.

Unfortunately it requires some hacks, namely changing a temporary Windows directory and patching distutils.

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

> Might need some documentation on how to manually invalidate the cache. We can potentially get into a bad state like e.g. #47305

Done! While this looks good, the `setup.py` changes may conflict with https://github.com/pandas-dev/pandas/pull/47380 fairly soon. Mind pivoting to other CI improvements (like environment caching) if you have the time until a decision has been made on the linked PR? This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. Could some of the hacks be avoided by only caching on non-windows? Only the TMPDIR one. Actually it might already be unnecessary with the latest version of sccache. @jonashaag status here?  i was looking forward to this one I put this on hold to wait for the Meson changes. Are they done already? > I put this on hold to wait for the Meson changes. Are they done already?

Seems like #49115 is almost ready, maybe a good time to update this? This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. Do you think the sccache-action could be easily be used for this instead? https://github.com/Mozilla-Actions/sccache-action This is already using another action. What would be the advantage of switching actions? TBH I think the actions are both very similar  Ah I didn't know if it would make this workflow any simpler, in addition to be more of an official looking ccache action by mozilla
 Closing in favor of https://github.com/pandas-dev/pandas/pull/53211