You mentioned that this is for windows. I looked at what psutil does for windows. It looks like psutil.Process (). Name uses the Windows Help API. If you look at the psutil Process code and trace.name, it will look in get_name () in process_info.c . It goes through all the parts of your system until it finds the one you are looking for. I think this may be a limitation of the dashboard API. But therefore, it is slower than .exe, which uses a different API path, which (as you indicated) requires additional privileges.
The solution I came across is to use ctypes and ctypes.windll to directly call windows ntapi. For this, you only need PROCESS_QUERY_INFORMATION, which is different from PROCESS_ALL_ACCESS:
import ctypes import os.path
source share