text: Title: %autoreload fails since 8.17.0
  Body: May be related to #14145 
  
  ```python
  In [1]: %load_ext autoreload
  
  In [2]: %autoreload 3
  Error in callback <bound method AutoreloadMagics.pre_run_cell of <IPython.extensions.autoreload.AutoreloadMagics object at 0x7f8877f5ad90>> (for pre_run_cell):
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  TypeError: AutoreloadMagics.pre_run_cell() takes 1 positional argument but 2 were given
  ```
  This caused no issues until including version IPython 8.16.1
  
  I use IPython from command line on Fedora Linux 38, Python 3.11.6 built from source, IPython installed from PyPI.