BUG: pd.replace changes dtype when using a dict to replace values even when there are no matches
- [x] closes #53539 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

I might be missing something here, so thought I'd ask before changing tests. The solution I found is to convert the dtypes of the resulting dataframe after the replace operation back to the original if no replacement was made. For inplace operations, `self` is overridden when `new_data` is generated, meaning in order to retain a copy of the original dataframe, I have to copy it before that operation takes place. I then use the copy of the original dataframe to check if no replacements where made and update the dtypes. This, however, creates a new `result` dataframe before return, meaning the np.shares_memory tests for inplace operations start failing. Not sure if there's a different solution I'm missing or if these tests should be altered to accommodate this fix. See comment in the issue, this is intended behavior  Thanks but based on the discussion in https://github.com/pandas-dev/pandas/issues/53539 this is the intended behavior so closing