The solution to the problem is simple if you have a FreeBSD ports tree installed.
To build a port for a specific version of python, execute:
PYTHON_VERSION=pythonX.X makeSubstitute X.X for the appropriate version that you require. Instead of the default py27-modulename, FreeBSD will build pyXX-modulename.
The default, of course, can be changed in make.conf (see man make.conf for details.)