As a native Buffalonian and someone who is currently attending UB Med...
Amherst and Williamsville are nice, but there really isn't much going on out there. You will be close to campus, but often the people who live there are the one's who are unhappy with Buffalo because they never actually go into the city to do anything. However, this area is very safe, close to south campus, and there are a large number of med students who live here.
University Heights is a bit rundown and I don't think too many med students live there. It is mostly undergrads and there has been a lot of cracking down on the area lately for noise, garbage, etc.
My personal preference would be to live somewhere in the Elmwood/Bidwell area, Allentown, or North Buffalo. These areas offer the most in terms of restaurants, shops, bars, parks, etc. I would say this is where you will find the largest percentage of 20-something med school-age people in the area.
Apartments are pretty affordable almost anywhere in Buffalo, so it is more a matter of personal choice.
Check out the classified adds at
www.artvoice.com for more apartment listings.
The above is obviously just my opinion. Amherst, etc. are nice places to live, but I tend to think the city offers a better experience than living out in the burbs.