Disclaimer: I'm in software QA (thus programmer-adjacent but not actually a programmer.) I'm also not a hiring manager, so I can only work with conversations I've overheard my coworkers having about what they look for and how they interview.
All that being said, I think most employers understand that you can't share you actual work from previous companies, so they don't ask for it. This is my impression from speaking to coworkers who conduct interviews, as well as my own experience discussing QA automation coding in interviews.
Is there some other way that prospective employers will accept as proof of my programming abilities?
They might ask you to complete a sample coding assignment to gauge your ability, or they might show you a snippet of code and ask you what it does. Also, the ever-popular "ask him to define coding concepts and other technical things." That sort of thing.
Programming languages and features change so rapidly these days that I think the focus of interviews most places is less on specific things you've done in the past and more on your general understanding of best practices, as well as your ability to learn new things.
Any discussion of past work would have to be limited to open source submissions (as Raf suggests) or personal projects you might have on the go, so those would be the things to include in a portfolio, if you want one.