A local <const> variable is not necessary initialized with a simple constant value, it may be initialized by the value of a complex _expression_ that needs to be evaluated only once, and its value stored somewhere.
Imagine you declare thousands of such local <const> variables, all these initializations must still be evaluated, independently of if the resulting value is used or not in the rest of the function.
The compiler may then try to optimize the code, by not storing the resulting values in a local variable, if the value can be evaluated as a real simple constant whose value is known at compiling time. In that case, it can use that known value inside the code and will not need to generate a local variable for the storage of this value
Only in that case then, the variable should not be counted in the limit of 200 local variables (including local variables added for declared function parameters; and including also the "self" local variable implicitly declared for functions declared with a colon-prefix to the function name when using the magic sugar of method-like function declarations, which are in fact assignment statements into the key of a table external to the function itself).
Now imagine the compiler accepts thousands of such "local <const>" variable declarations in a function body. It will not know when parsing them if these variables are used or not: it will know that only after parsing the whole function body. So it could only emit the error about the quota being exhausted and the final "end" keyword of the function body, or when anywhere during the parsing of the body the compiler detects the 200th local variable being actually used.
A "use" of the local variable must be counted for a function named parameters or "self" along with the implicit "use" of all named parameters. For example:
function (a,b) return b end
Only the second parameter "b" is explicitly used, but parameter "a" is still used implicitly by the fact that it uses storage in the stack. But note that you can call a function with of to 242 arguments (even if they are not named, by using varargs, so that you can write:
print(1,2,3,4, --[[...], 241, 242)
print(1,2,3,4, --[[...], 241, 242, 243)
which generates a parsing error for a too complex _expression_: there's also a limit on the number of values you can push on the call stack before calling the function.
However you cannot declare an argument name in the function body for all these 242 allowed arguments, only for the 200 first arguments at most; arguments number 201 to 242 can only be used by the function in vararg expressions; if you have declared 200 arguments for a function, you're not allowed to declare any additional local variable in the function body, but you can use arguments 201 to 242 !