So the question is, does a variable which no longer has a value still have any footprint in RAM,
Yes, the table entry for a variable persist for the whole runtime of a program. Those tables are only made to be extended, never compacted.
It also doesn't make much sense otherwise, as the interpreter has no way to know if a variable will be used again further down the road. Even more, a zero length string is still a valid string. Same goes of course for numeric ones, as a value of Zero is still a valid value.
Details
So the question is, does a variable which no longer has a value still have any footprint in RAM,
Yes, they still occupy an entry in the variable table.
In applesoft all simple variables are stored in a single data structure reserving 7 bytes per variable. It holds the variable name (*1), variable type and for numeric variables it's value. For string variables it contains the string length and a string pointer.
That way an empty string variable is already reduced to the minimum.
or was the implementation clever enough to remove it
No, as there is no way to decide that.
Also, removing every variable that reaches zero at some point would mean the table has to be reorganized all the time. That is if the goal is to save space. That's moving memory around, wich is about the most costly operation there is on 8 bit CPUs.
On a side note, it would also remove one of the most potent ways of improving execution speed, which is defining variables in sequence of most common usage (*2).
and only return empty-or-zero values of variables that didn't exist in the variable lookup table?
Not to mention that each 'temporaty deleted' variable would incur the maximum access penalty when used again - as the whole table has to be searched to find out it's zero (*3).
Of course some of that could have been coped with by having the variable table sorted by name, so a halving search could be used, speeding up all access. Still management would increase execution time notable - the crux of a ad hoc variable declaration instead of compile time allocation.
Not to mention that we're talking about BASICs that had to fit into some 4..12 KiB ROM space. Not much room for such luxury.
Developer back then rather spend any available space for including more functions to simplify life - remember, having doing a computer a job is way more fundamental than having it doing the same job fast.
*1 - Or mor exact only the first two bytes, as only those are valid. The variable type is stored in the high bit of those bytes. That way integer, real and string variables can have the same name but still be different.
*2 - It was a common 'trick' to define most needed variables first in a program as that could lead to dramatic speed improvements. That way the most needed were found first (*3). See for example this program.
*3 - Any access to a variable is made by a linear search thru the variable table.
RUN
also cleared variable storage.CLEAR
and thenPRINT X
I will get zero as the language doesn't have a concept of NULL or NaN as far as I've ever seen over the years.