Replacing old toilet flange, pipe seems really messed up
I would be looking at using a toilet flange replacement/ extender.
The problem may be you will have to remove the lead.
Most of the old timers that did use lead were not using it by the late 70’s but if they came into a problem they would still use lead as they were more comfortable with lead than plastic. Another thing there were not as many available repair options like “flex on”or “twister” that both flanges have extended tails to tie into old pipes.
You may be able to use a 3” to 4” repair where the 3” flange drops down and seals to the 4” pipe. This might be a way to get past the lead bulges.
Putting in a 3” won’t be a problem as many homes are completely plumbed in 3” and have a standard “closet” or toilet flange.
The high end extended flanges can run close to 50$ but many are available for 1/2 of that but I think an extended replacement would do the trick and get past the mess of the lead.
If you have access you might consider cutting the entire mess out and replumbing but the cases where I have seen lead used it was because there was no access and lead is not that hard to work with but is really a lost art if you consider plumbing drains an art form.