I've written a 40k line program in python3. Now I need to use a module throughout my program that is called pytan which will impart a functionality addition. The problem is that pytan is written in python2.
So is it possible to switch the interpreter to python 2.7 inside one script that is called by another running in python 3?
What's the best way to handle this situation.
You cannot "switch the interpreter to python 2.7".  You're either using one or the other.  Your choices are effectively:

Come up with an alternative that doesn't require the pytan module.
Modify the pytan module so that it runs under Python 3.
Modify your code so that it runs under Python 2.
Isolate the code that requires pytan such that you can run it as a subprocess under the python 2 interpreter. There are a number of problems with this solution:

It requires people to have two versions of Python installed.
It will complicate things like syntax highlighting in your editor.
It will complicate testing.
It may require some form of IPC (pipes, sockets, files, etc...) between your main code and your python 2 subprocess (this isn't terrible, but it's a chunk of additional complexity that wouldn't be necessary if you could make one of the other options work).
How do you use a python2 module inside a python3 program