A friend of mine experienced this same problem. The error is generated within an eval in Expat.pm, while the module is trying to figure out what kind of data you passed it. Do you have a $SIG{__DIE__} handler set up that isn't checking to see if the die was generated by eval? Or, are you running under mod_perl?
I'm not sure if it will work, but you might try putting Twig->parse() in its own block, with all warnings turned off. If this doesn't work, maybe you can register your own $SIG{__DIE__} handler (if you aren't already, but something else is) that checks $^S.
hth,
--rpc