I dug through the Twig code and found that this works fine:
$twig = new \Twig_Environment(new \Twig_Loader_String, array( 'autoescape' => false));