Thanks to Adon and Timus I found two solutions that work even faster within my class.
def read_file(self, start):
self.readstart = start
with open(self.filename, "r") as f:
f.seek(self.readstart)
line = f.readline()
content = ""
while line:
content += line.strip()
line = f.readline()
if line.strip().startswith('>'):
self.content = content
return
and
def alt_read_file(self, start, end):
with open(self.filename, "r") as f:
f.seek(start)
self.content = re.sub(r"\s+", "", f.read(end-start))
The answer to my initial question is that probably by string concatenation of a class variable each time memory allocation is renewed by the Python interpreter.