BUG: Fix to_excel storing decimals as strings instead of numbers (issue #49598)
- [x] closes #49598
- [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.

This is the same bug fix code as PR #50174, which went stale and had no tests. The author of that PR is no longer responding. This PR adds tests and release notes.
Thanks @michiel-de-muynck  Hi, thanks for your work! 
When I export a dataframe to my PostgreSQL database with `to_sql(...)` using `if_exists='replace'`, `decimal.Decimal` values are stored as `TEXT` instead of `DECIMAL`. Does this patch also fix this issue? Hi Lorenzo, this only affects Excel, not PostgreSQL. @mroeschke this is milestoned 3.0 but the whatsnew entry is in 2.3. does that need to be addressed (or backported)? Oops the whatsnew entry should be moved to `v3.0.0.rst`. Could you open another PR to do that @michiel-de-muynck? 