The problem I have found about CLEAR, at the end was very simple to be fixed. I needed to define T AS STRING, but I solved defining T AS SINGLE (and even INTEGER is working) and then converting it in string with _LTRIM and STR$. But, when the code starts to be long and complicated, like the mine with 12 subroutines and almost 2000 lines, it becomes difficult to distinguish if the problem is about something wrong somewhere in the code, or a bug. Generally, 999 every 1000 times the problem is something wrong in the code, so one doesn't think about a bug and finishes to spend much time in searching an error. Finally, one can suppose a bug, but even in this case, it is impossible to know that the problem is in something apparently separate: how one can suppose that there is a conflict between CLEAR and defining a string in TYPE?
Even when I wrote the first post, I was not thinking about a bug in CLEAR, and I was convinced that there was someting wrong in the code, or maybe a wrong use of CLEAR. I found the bug only cutting the first example in order to make it more understandable for you. And, as you say that CLEAR is buggy, maybe there are other bug in it.
I think that it will be nice if CLEAR will be fixed, because I think that it is not a marginal command, as RUN, but a very important one: it is common that a program has to restart itself without exiting and rerun it, so it is important to have a simple and well working command that clear all variables without the necessity to create specific routines to do it.