API: replace() should raise an exception if invalid argument is given
- [x] closes #18634
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I used `is_scalar()` instead of `is_numeric()` to allow data structures like pd.Timestamp to be used in `replace()`. See tests in pandas/tests/frame/methods/test_replace.py, pandas/tests/series/methods/test_replace.py for examples.
thanks @a-y-khan  Glad I could make a contribution!