When I made my four way indexing back toolpost for my lathe, I made the square headed screws to clamp the tools.
Admittedly, they were M10, and 1/2 bar was the ideal material.
The title of the thread, initially, led me to imagine square headed fasteners, more like coach screws, until it became clear that the heads needed to be long for tool clamping screws.
Maybe make your M5 ones from some 1/4 inch round bar, so that you get the short flange just above the end of the thread? You only need to make eight, at most. For a small toolpost, (It will be if it uses M5 screws ) you probably only need 6. So not a major mass production job!
Howard
Edited By Howard Lewis on 29/06/2019 10:17:03