PERF: Slowness in multi-level indexes with datetime levels

Special case handling of sliced multi indexes, where there the length of the level values may exceed the length of the index.
Corrected nan handling issue introduced by the original change. (+1 squashed commit)
Squashed commits:
[0dae170] PERF: Slowness in multi-level indexes with datetime levels

Special case handling of sliced multi indexes, where there the length of the level values may exceed the length of the index.
Merge pull request #8549 from mtkni/master

PERF: Slowness in multi-level indexes with datetime levels (part 2)