text: Title: Feature Request: magic command to paste code from file and execute
  Body: There are multiple instances where one would want to send code to a running IPython terminal from an editor (a la Spyder). An example of this would be this extension for VSCode https://github.com/hoangKnLai/vscode-ipython which works really well in its current state. However, it's using the "%run -i" command to run code that resides in some temporary file.
  
  The "%load" magic command can be used for such a task, but it does not execute the code, it simply pastes it in the terminal. This requires sending multiple "enter" keys to the terminal to execute the code, and it also keeps the "%load ...." tag at the top which contaminates the history in case the user wants to re-run the same code block from history using the up arrow. It looks like this command was mainly designed for injecting code from a file into a jupyter notebook cell.
  
  There is another "%paste" magic command but loads code from the clipboard, but the clipboard tends to be a little sluggish and act up especially when firing multiple commands from the editor (think running code line after line).
  
  A potential solution is using "%run -i path/to/file.py" which the aforementioned extension implements. However, looking at the source code for this magic function, it seems to be making some manipulation to the user name space, among other things. We are not sure if it's "safe" to be using the %run command for this.
  
  Would it be possible to add a new, simple magic command, call it "%fpaste" that does the same thing as "%paste" but loads code from a file instead of the clipboard? There are no namespace checks of any sort, it simply loads the code in the current session and executes it. It would simplify things a lot for extension developers since we can just send a "%fpaste path/to/file.py" to ipython and it automatically loads the code and executes it. This way we don't have to send multiple enter keys to the terminal.
  
  Here is a simple implementation that I am using currently to create a custom magic command that does exactly this:
  
  ```python
  # ~\.ipython\profile_default\startup\fpaste.py
  from IPython.core.magic import Magics, magics_class, line_cell_magic, line_magic
  
  # The class MUST call this class decorator at creation time
  @magics_class
  class MyMagics(Magics):
      @line_magic
      def fpaste(self, line):
          import sys
          from pathlib import Path
          contents = Path('path/to/pycode.py')
          sys.stdout.write(self.shell.pycolorize(contents))
          self.shell.run_cell(contents, store_history=True)
  
  get_ipython().register_magics(MyMagics)
  ```
  
  This works pretty well. I had to keep the import statements for path and sys inside the function otherwise I have to import them again after doing a hard reset with "%reset -f".
  
  The current workflow in VSCode would look like this:
  [in editor]
  trigger keybinding that sends text to ipython, VSCode writes the contents of the selected code or code cell to the pycode.py file, then send a "%fpaste path/to/pycode.py" to the integrated terminal running ipython, then finally sends one enter key to execute the whole statement.
  [switch to integrated terminal running ipython]
  ipython executes the code because that's what the %fpaste implementation does, the execution is separate from printing the code to stdout. Maybe a better implementation would be to skip writing the contents to stdout in case that's not a desired behavior, we can just execute the code.
  
  Note:
  Since history is set to true in the fpaste function, we can easily hit up arrow and rerun the code if needed.
  For some reason that I don't understand, the %fpaste tag does not show up in the history. Is this by design? It is the needed behavior but it would be nice to understand why it's happening. As mentioned, using the "%load" command tends to inject the magic command tag in history as well, which pollutes the code a little when the user wants to re-run it.
  
  Here is a screenshot of what this would look like (using IPython classic prompt):
  
  ![image](https://github.com/ipython/ipython/assets/37887075/a28780f7-eac0-4983-9e20-7a94951db210)
  
  Same snippet ran using the "%load" command:
  
  ![image](https://github.com/ipython/ipython/assets/37887075/8812a6bd-c905-43cf-9e9a-bee8b26a6123)
  
  
  
  
  
  
  
  