CLN: Use ABCs in set_index
This follows up on #25085, where part of #22486 was reverted for 0.24.1 due to #24969.

This PR is independent from #24984, and re-adds the ABC-classes in the instance-checks that was originally required in #22236 and then realised in #22486.

There's also some slight reshuffling due to redundant instance-checks, and the somewhat confusing structure that all but the last array get added in the if-branches.
