This is not a complete solution, but more thoughts than comments.
You have a box left and right and above and below your image. If you delete this and even cut the text in the process, you will still have enough information to align the image. So, if you chop off, say, 15%, from above, from below, left and right, you will reduce the image area by 50%, which will accelerate the movement along the line.
Now take the remaining central area and divide it into, say, 10 strips of the same height, but the entire width of the page. Now calculate the average brightness of these stripes and take 1-4 of the darkest, because they contain the most (black) inscription. Now work on each of them in parallel or just the darkest. Now you process only the most interesting 5-20% of the page.
Here's the command to do it in ImageMagick - it's just my weapon of choice, and you can do it just as well in Python.
convert scan.jpg -crop 300x433+64+92 -crop x10@ -format "%[fx:mean]\n" info: 0.899779 0.894842 0.967889 0.919405 0.912941 0.89933 0.883133 <--- choose 4th last because it is darkest 0.889992 0.88894 0.888865
If I make separate images from these 10 stripes, I get this
convert scan.jpg -crop 300x433+64+92 -crop x10@ m-.jpg

and effectively, I am aligning on the fourth last image, and not on the whole image.
There may be an unscientific, but rather effective and fairly simple way to try.
Another thought, if you have your procedure / script sorted to straighten a single image, don't forget that you can often get mass acceleration using GNU Parallel to simultaneously chase all your beautiful expensive processor cores. Here I indicate 8 processes for parallel operation ...
#!/bin/bash for ((i=0;i<100000;i++)); do ProcessPage $i done | parallel --eta -j 8