Use carefully, there are security issues with sudo and variables.
From man sudoers I found that you should use
Defaults env_reset
Defaults env_keep += "PYTHONPATH OTHERVARIABLE YETANOTHER"
In Ubuntu, sudo does preserves some variables. sudo -i more like loging in and then running the command.
Both may be inconvenient, the former for sudo nano myfile leaves root-owned files inside your home and the latter for sudo -i nano myfile will try to open /root/myfile.
I guess Solaris should be the same.
Edit:
I looked more into it and it seems that the distributions take a lot of are with PATH and you really should be careful before playing with it. Please, don't add something like "." to it, it is unsecure.
So, run
sudo printenv PATH
and see what it gives. Here it gives
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
for example. Now run sudo visudo and add the line
Defaults secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
replacing by what you found just before. Append a new path to it if you need.
About libraries:
sudo LD_LIBRARY_PATH=/usr/lib/path/to/a/safe/library your command
But be careful about adding "." or /home/username.
Oh, by the way, be careful.
Last but not least, be careful.
(Bypassing sudo security measures may render your Solaris as safe as Windows XP.)