I'm looking for a way to set a variable that isn't buffer local in such a way that it will act like one.
It's possible to do it with file local variables, but I haven't found a way to set a variable in this way from elisp.
I don't want to rely on defining file local variables with comments inside of them.