Juxta over on the TextDrive forum pointed out a good use of PHP’s array_map() function that I hadn’t thought of which gets around the annoying fact that some hosts set magic_quotes_gpc to on. In short:
if (get_magic_quotes_gpc()) {
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
}