python: Factor out lib_cellar

… in favour of DRY. Fixing the build of Python for Linuxbrew required this patch to factor out lib_cellar (homebrew/linuxbrew@4b5e6e9eab2dbb89f1a1f9561a3c93fc6578b6c1), and a patch to disable the Mac OS specific features of the python formula (homebrew/linuxbrew@3ad2130b339b3d72764d1b5c11591bb22652495a).