Only SGI IRIX 4 supports dynamic loading of modules using SGI dynamic loading. (SGI IRIX 5 might also support it but it is inferior to using shared libraries so there is no reason to; a small test didn't work right away so I gave up trying to support it.)
Before you build Python, you first need to fetch and build the dl package written by Jack Jansen. This is available by anonymous ftp from ftp://ftp.cwi.nl/pub/dynload/, file "dl-1.6.tar.Z". (The version number may change.) Follow the instructions in the package's "README" file to build it.
Once you have built dl, you can configure Python to use it. To this end, you run the configure script with the option -with-dl=directory where directory is the absolute pathname of the dl directory.
Now build and install Python as you normally would (see the "README" file in the toplevel Python directory.)