This results in a warning ‘[WARNING]: Found variable using reserved name: q’
If I change the variable in the included file to ‘varwithanr’ no warning is printed.
Yep, but until the backports that were created today it was only fixed for devel, not for stable-2.18 or stable-2.17. Now backports exist and the next 2.17.x and 2.18.x releases should not have this (anymore).