REF: prepare (upcast) scalar before dispatching to arithmetic array ops
This moves the potential upcasting of python/numpy scalars to pandas scalars out of the actual array op  (`arithmetic_op`), but moves it up to the Series / DataFrame level before calling the array op. This avoids calling it repeatedly on the same scalar for each column.
How costly is this?  I get that its a valid optimization, but it breaks the abstraction of the self-contained op. This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. > How costly is this? 

In the same `FrameWithFrameWide` benchmark (as mentioned in https://github.com/pandas-dev/pandas/pull/39820#issuecomment-825185163), calls to `_maybe_upcast_for_op` currently take around 8% on master. But I expect this number to become (relatively) bigger with other optimizations merged (like #39820). For reference, the actual `add` operator only takes around 18% in this benchmark, with everything else being overhead that can be partly optimized away. 

> I get that its a valid optimization, but it breaks the abstraction of the self-contained op.

We already do other preparation steps before the actual array_op as well (extract_array, extracting zerodim, checking length, wrapping datetimelike, etc). So I don't think the abstraction holds right now, and there is certainly an opportunity to organize this better. For example, we can ensure to have a clear set of steps (factored out as consistent helper functions) that need to be taken in the different code paths where `array_op` gets called (eg both in series op as frame op) > We already do other preparation steps before the actual array_op 

Fair enough.

Generally LGTM.  Should this wait until after the ensure_wrapped_if_datetimelike PR so that can be folded into this helper? looks fine. this helps with perf? > this helps with perf?

Yes, see https://github.com/pandas-dev/pandas/pull/40479#issuecomment-825191578 thanks @jorisvandenbossche 