How to get user environment variable for smf daemon?

I am new to smf...I am trying to create new smf service and starting a Python daemon script. The python daemon script will call few other scripts internally as subprocess. The scripts which are called by daemon are unknown of user environment variables. How can I execute smf service in user execution environment so that I can get all the environment variables of the user.

I know there is a provision to add environment variables for service. As there are too many variables used for execution, I don't want to add all of them. Rather I want scripts to execute in user shell environment.

Short answer: use su - username to log in as that user. In C programming you call setuid()
However I'm confused.
example for user foo

su - foo -c "/path/to/executable/script"

All directories and files opened by the script have to have permissions set to allow this. This means that parts of the script environment become insecure.
Which may or may not be important.

pargs -e [process_pid]

shows the environment variables for any process - when run by the root user. It actually seems to me like that is what you are asking about.