One very efficient way to separate areas by squares is to put them in diagonal lines. This utilises the diagonal, which is the longest dimension of the square.
Also, you can divide the plane into separate X-pentominoes (which have the maximum allowed connected area) by using diagonals of squares only.
That pentomino pattern has the annoying property that choosing any 10x10 square tends to bring in an overly paint-filled edge row. However, it's possible to "change the parity" of the pattern at one of the diagonals, which gives edges with no more than 3 painted squares on any of them.
While I have no proof that this is the best answer, the above observations give a reason to guess that this is likely to score pretty well:
The pattern has a total of
35 coloured squares.
EDIT: After giving it a couple of tries, any variation based on the X-pentomino seems to result in this exact solution after a couple of optimisations.