Line 143 of lib/TWiki/Plugins/PreferencesPlugin.pm is the outdented and uncommented:
print STDERR "GEF $name=$value\n";
Unfortunately, all the world is not Apache and on, for instance, SunOne web server, STDERR gets sent to the same place as STDOUT and this causes a 500. Suggest commenting it out. Leaving this as Normal because most developers probably don't care about non-Apache platforms
Thanks for reporting!