Expose a utility function to use for sysconfig/distutils paths+scheme handling like pip
xref: https://github.com/pypa/pip/issues/11585
Basically, the idea is to mimic the logic in pip's locations subpackage, and expose that via a single function to end users.
Does the locations subpackage do anything other than handling vendor patching?
Yes.
See https://github.com/pypa/pip/blob/90f51db1a32592430f2e4f6fbb9efa7a3a249423/src/pip/_internal/locations/_sysconfig.py#L124 and the distutils equivalent for some of the details.
There's also logic to handle the underlying sysconfig/distutils migration, which may be worth mirroring here (depending on how complex that would be).
From #146, we should probably also expose this in the CLI.