sv_reset: Don’t skip THINKFIRST items

Commit 9e35f4b3b4 made sv_reset skip SVs other than refs that had
SvTHINKFIRST set.  Back then SvTHINKFIRST was only true for refe-
rences and read-only variables, so this change was technically cor-
rect (except for skipping arrays and hashes, which this commit
does not fix).

But SvTHINKFIRST was expanded later (beginning in commit 6fc926691,
by the author of 9e35f4b3b4), making this code in sv_reset wrong.

In all fairness, it was already wrong before for things marked FAKE,
just differently wrong.
reset.t: Basic tests for resetting aggregates

This probably incorrectly dies on VMS, based on code inspection.  Com-
mit  b0269e46d appears to have added the VMS-specific code in the
wrong place.
Stop reset from skipping @ % if $ is read-only

reset has been wrongly skipping arrays and hashes in the same glob as
read-only scalars since commit 9e35f4b3b4.
sv.c:sv_reset: Remove %ENV handling; fix for VMS

The special env handling (calling my_clearenv) in sv_reset is com-
pletely unnecessary, because
 • sv_reset calls hv_clear
 • hv_clear calls mg_clear for magical arrays
 • mg_clear calls magic_set_all_env for %ENV
 • magic_set_all_env calls my_clearenv
so it gets called twice (confirmed with gdb breakpoints).

The VMS handling in sv_reset was wrong, because it was not even inside
the if(gv==PL_envgv) condition.  It was croaking for any hash, not
just %ENV (the fault of commit b0269e46d).  (This was based on code
inspection; not actually tested.)

Handling %ENV specially in sv_reset has been unnecessary since ‘clear’
magic was added to %ENV in commit fb73857aa (inseparable changes from
patch to perl 5.004_04).
Remove special string handling from sv.c:sv_reset

Once upon a time, "" and undef were equivalent, and str_reset (as it
was called) would turn a scalar into an empty string.

Since commit 79072805bf6 (perl 5.0 alpha 2), sv_reset has set sca-
lars to undef.

Setting SvCUR to 0 and *SvPVX to '\0' (converted from str->cur and
str->ptr[0] by the same commit 79072805bf6) has not been neces-
sary since.
Don’t taint undef in reset

reset was tainting undef if the internal SV type happened to be SVt_PV
or higher.  This has got to have been a mistake.  Tainting undef or
what is known to be an empty string does not make sense, even in a
tainted expression.  Tainting it based on the internal type does not
make sense either, and results in inconsistencies in behaviour (taint
it if it *was* a string, even though it isn’t now, but not if it was a
number, unless that number was tied, or had pos() set, etc.).

This tainting has been here since perl 3.0 (commit a687059cb), which I
think was when tainting was introduced.

Applying the tainting based on the internal type has happened since
79072805bf6 (perl 5.0 alpha 2), which introduced different internal
SV types.
[Merge] Fixes to reset("...")

I tried to make copy-on-write more pervasive, and reset.t started
failing.  So I found myself reworking sv_resetpvn (i.e., deleting
parts of it).