A couple other factors I think weigh in favor of usually saving before paying down the student loans:
If you have a relatively high paying job as a single person who is young (22-32, $50,000+) and you don't own a house, your tax rate is probably pretty high. You don't have little deductions, a lower paid spouse, or a mortgage deduction. So, if your top rate is 20%, your 401K savings are going to "automatically" grow by that much even with no other returns.
You can't get years of 401K building back, each year has a limit.
If your loans are federal, they are flexible. So, if later your income dramatically drops, you might be able to have the payment reduced/deferred/ forbeared and you will still have the loans gone in 25 years. This isn't true of the 401K- if you don't save, they won't automatically put a bunch of money in after 25 years, and you will just have to stop saving if you can't make ends me. Therefore, if you have the ability to put the money in now, take advantage of it.
401K funds are accessible to you later, while payments you make on your student loan aren't. You shouldn't plan on them as your emergency fund, etc. But, in a really true emergency in which the choice is pay a penalty, lose the 401k and avoid a foreclosure/ bankruptcy/ abandoning a child/ avoiding a medical treatment, I think the 401K funds are fair game.