This ought to get you most of the way there.
x = re.compile("([A-Za-z0-9%./]+=[^\s]+)")
out = x.findall(input_str)
# out = ['website=http%3A%2F%2Fwww.test.com%2F&number=1037319821&comment=Test+mea&gender=male&submit=Submit', 'id=1234&variable=test&firstname=John&lastname=Doe&gender=male&submit=Submit']'