def remove_command_line_sys_path():
    """Function that removes additional paths in Blender's sys.path"""
    addon_name = _get_addon_name()
    prefs = bpy.context.preferences.addons[addon_name].preferences
    additional_system_paths = json.loads(prefs.sys_path_list_str)
    for additional_sys_path in additional_system_paths:
        if additional_sys_path in sys.path:
            sys.path.remove(additional_sys_path)
    prefs.sys_path_list_str = "[]"
Function that removes additional paths in Blender's sys.path
photogrammetry_importer/preferences/dependency.py