I'm trying to make a function to read a whole buffer and find lines that match with regexp, I think to read the whole buffer and save to list of strings but I read that it's very inefficient. Whats the better form of do this?
It is really unclear what you want to do, but if you are looking for an "end in itself" interactive use, then you are probably covered by one of
occur et al: e.g., M-x occur RET TODO RET.
If this is a step in a long processing chain, you should start with the sources for the above commands and ask a separate, more specific question.