Seems to me the French had a rule of thumb that the crank arm should be about 20% of your total inseam. I stand 6 feet and my inseam is about 33 inches. that times 0.2 is 6.6 inches. Converted to mm is 167mm. Round down to the nearest size if you spin, round up if you mash.
Mashing is known to be bad for your knees FWIW.
The important thing here is that the entire rest of the bike is supposedly supposed to fit you- the seat height and angle, the length of the stem, the size of the frame. Why should we not also have the ideal crank arm length? I can make a 175 go around and I have 170s on most of my bikes, but I find that I make more power (spin faster) with a 165.
If you have knee pain you will do better with a shorter crank and a shorter crank means you are less likely to develop knee problems. My girlfriend does quite well with a 140 crank (which was hard to find); she has had knee surgery and often has knee pain. But with the short crank she gets no pain at all even after an all-day ride. She has no trouble keeping up too.
I think there is a sort of macho thing that says you should get longer crank arms. For this reason people tend to discount the shorter crank arm thing out of hand without giving it due consideration (much less giving it a try). Having gone to shorter crank arms after using long ones I'm not likely to go back- I can ride faster.