Catch exception around much smaller piece of code
Broken off of #23675, followed by refactor.

The refactor has a non-trivial diff, but the only actual _logic_ changed here is the `except ValueError as e`, instead of catching everything from L240-L303, now specifically only catches errors raised by `tslib.array_to_datetime`.  Everything else is just moving code outside of the try/except block and de-indenting.

Catching more specific exceptions is worthwhile in its own right, but this is also an important step for implementing `DatetimeArray._from_sequence` (@TomAugspurger, @jorisvandenbossche, @jreback) since after this we can isolate the part of `to_datetime` called by `DatetimeIndex.__new__` (xref #23675) to make the constructor non-circular (and then refactor it out into `_from_sequence`).

cc @mroeschke 