80 hours is about the average.
But that includes a lot of haphazard students, most of who are recreational.
If you're motivated, and have a reliable school/instructor you should be able to do it in 50-60 depending on aptitude and other factors (wx, etc).
Getting it done in 40 would be rare, high aptitude and motivation, and good instruction. Most instructors will probably not be interested in "shooting" for a 40-hour finish because that sets unrealistic expectations and may even be dangerous. 40 hours is probably for kids who grew up around aviation, had a pilot parent and a plane in the family.