You could use a lib such as multiprocessing (
https://docs.python.org/3/library/multiprocessing.html) to run the generate_random_wif function in parallel.
This will most likely improve performance, as you will be running multiple instances of the same function at the same time.
if you wish, please write down the code you mean, so that it runs well. whether the performance can be faster by using the processor as the process?
