I don't know if I understood your problem very well. But have you ever tried to read the string file and transform it into a lower without using a library?
Like this
open("file.txt", "w").write(content) if (content := open("file.txt").read().lower()) else None
And if you have more files you can just add for loop
Like this
[ open(file, "w").write(content) if (content := open(file).read().lower()) else None for file in ["file1.txt", "file2.txt"] ]