I'm primarily using Drupal and am considering moving away from CMS.  If I were to build my own platform could I integrate modules like commenting systems, user login, etc. through a PHP/Python API?  What would be the proper steps/good places to look/good tutorial on this?  Would I have to build all of my own tables manually to suit the needs of such custom modules?  I'm wondering if this would even be possible with out having to hard code all of this by hand?  Thank you.
First of all if you are considering moving away from CMS than you should consider using some sort of framework but with time you will come to idea that you need your own shit in order to be satisfied.
Second, subject you are trying to decipher is a little bit more complex than just writing it down here. 
I would suggest you to first think what do you need. What is your main goal with it or what are you trying to accomplish? For example in meaning of commenting, if you want the truth nor PHP nor Python are masterpieces. Why not to consider Node.JS for that?
I mean, web is becoming real-time more and more. Now days we have scripts or to be more precise, pieces of art such as Socket.IO who can with help of Node.JS handle large amount of traffic without any problem. Something nor Python nor PHP can do.
Some stuff you will need to code by yourself but most of the time you just need to code "architecture link" between one versus many features. Eg. take some code and adjust it to be able use it from your own framework or whatever.
As far I see it. I like to do all crucial parts by myself but for example there is Zend Framework and you can use ACL + Auth library and start from there.
Hope this makes some sense. Cheers!
Are there comment system/user loggin type modules through PHP API/Python API outside of CMS?