It appears that two seemingly colorful expressions, balls out and balls to the wall are actually perfectly innocent expressions no more crude than the expression petal to the metal; all three expressions basically mean the same thing and appear to have similar origins just for different machines. As far as a I can tell, balls out refers to steam engines with
centrifugal governors [1], in which the balls are out when the engine is running at top speed. Similarly, balls to the wall refers to the throttle position on airplane that have spherical throttle knobs with multiple throttles; full throttle means pushing the balls all the way to the wall.
[2][3] Correct me if Slate and Urban dictionary have lead me astray.
PS
It appears that, contrary to the story I had heard about cannon ball racks being called monkeys, the phrase
cold enough to freeze the balls off a brass monkey is, in fact, crude.