Sorry that I don't have an answer for you, other than just taking the attachment with you when looking at new powerheads.
I did see some square shafts on Echo attachments a while back, but no idea if they'll fit a Ryobi or anything else.
I'm in the same spot actually, wanting new powerhead.
And good lands, the price of a new trimmer has gone up in the last couple years, aint it?
I've always caught some sort of 30cc variant of the Ryobi on Craigslist, but they seem to have dried up. ( I understand the RC airplane crowd has been poaching them, also

)
Usually ethanol damage is the reason people were getting rid of them.
Sometime it's had a car driven over the attachment, etc.
Go see unit and if didn't seem scored, run lean and scraping when you pulled recoil, I'd probably take it.
Yeah, just swap out the attachment hanging at the house.
Carburetors usually were on Ebay for a few bucks $15 or so.
Swap out fuel related stuff and usually get several seasons out of one.
But no way to find any crankshaft seals for them. And no dimensions listed.
Sometimes you might find a shortblock listed somewhere, but that was always more cost than the unit was worth.
I've wondered about the 26cc Ryobi (full crankshaft?) And I absolutly despise the having the recoil built into the middle of any machine!! Always that "easy-start" crap that bends up in them.
But just no way to know if the 26cc have the grunt like the 30cc motors.
180 bucks (Lowes) for a straight shaft one in my area.
argh. I'll likely just dig through my "treasure" pile one more season for something or other.