CLN: clean core.construction._extract_index
Return early in the case of len(data) == 0, thereby avoiding needing a long `else` clause. Also clean type hints.

EDIT: The PR looks a bit messy at first sight, but it's mostly just dedenting stuff. Checking "Hide whitespace" makes the PR much clearer, as suggested by @MarcoGorelli in #49921.
Updated.