Deforming the Image as Lenses Would
Camera lenses deform the view. If you want to deform the rendered image, there are quite a lot of ways to do that in Blender. You could use Blender's compositing functionality, or you could also use an emission shader for shade-less material and map an image or a movie to some 3d object like a plane and use all the tools available in material nodes, that would include manipulating texture coordinate vectors with any math or manipulating the UV mapping or you could even deform the geometry that has the image or movie projected on it in 3d space. Obviously you could also do all the mentioned things together one on top another if you wanted.
Projections
Programming unrealistic projections or manipulating volume of the camera view does not seem to be possible using Python. It might be possible in OSL.
You could however achieve some interesting results without programming.:
Baking Functionality
It is possible to bake a color of a completely reflective surface so it is possible to define the shape of the projection with any geometry you wish:
Its best to disable all Cycles rays except camera so that the 'camera' object does not interact with the lighting in the scene in this case. Rendering an animation with this way would require some Python scripting.
In addition to that objects with Refraction BSDF shader could be used to construct lenses.
Constructing Lenses for Cameras out of Refractive Objects
Another way with an actual camera would be to make a lens from a refractive object:This kind of 'lens' could approximate the curvature of the volume visible by the camera as well because it can be constructed out of multiple objects. It might be very intensive on render resources if you wanted it to be more precise and it is limited by the way refraction works in Blender's Refractive BSDF shader, but it is possible: