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.
The failures are because #23752 hasnt been merged yet. I think these changes to the docs are small enough to be added to #23752 and not overcomplicate things with dependent PRs. Do you mind adding them there? Ok, I've moved it. didn't think it would be this small:-)