When I wanted to re-import the startup.py file after I made some edits, I used:
import imp, startup
# Use last 3 lines to reload script after saving edits
imp.reload(startup)
from startup import *
run_function()
This saved me the trouble of having to restart QGIS.
Since imp has been removed in python version 3.12, use importlib instead:
import importlib, startup
# Use last 3 lines to reload script after saving edits
importlib.reload(startup)
from startup import *
run_function()