Computing overlap, kinetic, electron-nucleus attraction and electron-electron repulsion integrals is possible even for Cartesian gaussians of higher angular momentum. There are analytical formulas which gives you the solution of these integrals. In particular you can find them in Cook's book [1] (pay attention to the fact that the electron-electron formula is wrong! See this discussion for details.).
If you don't have access to Cook's book [1], you can find a detailed derivation of analytical formulas for overlap, kinetic energy and nuclear-electron attraction integrals in Refs. [3, 4, 5].
These formulas are quite straightforward to implement (apart from the computation of Boys function, see this discussion) but they are highly inefficient. This is the main problem!
This is why alternative methods have been developed. In Helgaker's book [2] you can find a good description of these alternative methods:
- Obara-Saika scheme
- McMurchie-Davidson scheme
- Rys quadrature
If you just want to write a working Hartree-Fock program you can just use the analytical solution at first. However, if you need efficiency you will need to look at these methods.
A side note: personally I love Python but it is really, really unappropriate for computationally demanding calculations! My Hartree-Fock program in Python takes at least 2 minutes to compute two-electron integrals in the STO-3G basis set (a minimal one!) for $\ce{H_2O}$, while a Fortran version of the same program takes a bunch of seconds.
[1] D. Cook, Handbook of Computational Chemistry, Oxford University Press, 1998.
[2] T. Helgaker, P. Jørgensen and J. Olsen, Molecular Electronic-Structure Theory, Wiley, 2000.
[3] M. Hô, J. M. Hernández-Pérez, Evaluation of Gaussian Molecular Integrals: Overlap Integrals, The Mathematica Journal, Vol. 14, 2012.
[4] M. Hô, J. M. Hernández-Pérez, Evaluation of Gaussian Molecular Integrals: Kinetic-Energy Integrals, The Mathematica Journal, Vol. 15, 2013.
[5] M. Hô, J. M. Hernández-Pérez, Evaluation of Gaussian Molecular Integrals: Nuclear-Electron Attraction Integrals, The Mathematica Journal, Vol. 16, 2014.