ENH/CoW: use lazy copy on replace method
- [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).
This PR is part of an effort to implement the Copy-on-Write implementation mentioned in #49473. More detail in this proposal https://docs.google.com/document/d/1ZCQ9mx3LBMy-nhwRl33_jgcvWo9IWdEfxDNQ2thyTb0/edit / with discussions in https://github.com/pandas-dev/pandas/issues/36195
@jorisvandenbossche I will need some clarification to help me handle CoW in `replace`. It feels like `replace` should return a copy. `replace` is probably a difficult case, because it has a quite complex implementation (eg https://github.com/pandas-dev/pandas/blob/5a36b5f5273f1c19fd0c9b6ca13d985a25316649/pandas/core/internals/blocks.py#L526-L777, and that's only part of it). 
I think for replace there would be room for avoiding an actual column for those columns where no value actually gets replaced. But that will require going through the implementation to identify those cases. 

I was going to suggest that it might be easier to start with another method (and I can give some suggestions), but I see you already started with `set_index` as well! Will take a look at that. This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.