Oh fer' God's sake. If you go to bed at a decent hour and wake up at a reasonable time (sleeping, let's say, from 11PM until 7AM) you will find yourself completely refreshed in the morning and able to stay awake and function without stimulants.
I don't see how any young, single, medical student with no familial responsibilities needs lose sleep on a regular basis because of studying. Budget your time. Have the self-discipline to study at a regular time every day for a finite number of hours. Do all of your partying on Friday or Saturday night and then go back to your study routine.
If you are studying ten hours a day and losing sleep you are doing something wrong. Additionally, at many schools lecture attendance is not even mandatory and this time can be used for highly productive studying on top of or in the place of your usual after-lecture study regimin.
With that being said, Diet Dr. Pepper was invaluable for me during third year when you really will work some long, non-mandatory hours.