> Unused includes will cause needless recompilation when headers are changed. Also, they pretend there are dependencies that don't exist.
>
> Fix both by removing them.
This is a backport of core#23044
Notes:
- the `CScriptCheck` forward declaration is needed by Bitcoin ABC, because the `CheckScriptInputs` function is declared in validation.h rather than validation.cpp
- I removed also two unused includes in validation.cpp flagged by my IDE