DOC: Change docs to use MultiIndex.codes
This PR updates the docs in accordance with #23752. That PR is quite large, so I've put the doc changes in a seperate PR.

This PR can be merged when #23752 is approved/merged.