A template parameter may be declared as boolean.
The VE form for template transclusion shows a tic box ☑ if the current parameter value is 1 or any text. The tic box is empty for 0 and this is fine.
Unfortunately and surprising there is a text input field, if the parameter value bar= is empty in previious source text, or does not appear at all.
Partially that could be helped by autovalue:0 in TemplateData, but there should appear always an empty or ticked checkbox rather than text input query if type:boolean has been requested.