Format the code using clang-format
The style is fairly close to what we have and at least enforces a consistent coding style. The only true change in style is no indentation for case in switch statements, the rest is a combination of styles we already used in one place or another, just not consistently.
There are a handful of outliers that I'm not very happy with (e.g. the __attribute__(printf) being split up and clang-format apparently being unable to align function argument names which I quite liked. But hey, just like ruff and cargo fmt it's better to have something that's not perfect but at least consistent.
Closes #868
Note that I'll add a .git-blame-ignore-revs file later once we have the fixed commit sha so git blame will simply ignore this commit.