I'm trying to find the most performance friendly way of denying access to specific files and folders via htaccess. (For example a .git folder, an .hg folder, the .htaccess file itself.) Is there some particlaur method, or combination, that is more performance friendly than the others? (FilesMatch vs DirectoryMatch vs RedirectMatch vs whatever.)
In an .htaccess file, the performance difference between any of those is negligible. They all do filesystem stat calls, which is the "expensive" part.
For the best performance, if you can, use LocationMatch directly in the VirtualHost of your Apache httpd configuration.