You asked

Which cheap 50mm or 40mm lens is the best value for portraits?

For portraits, the guide puts the lens ahead of the body, so the lens choice matters most here. Of the lenses in this catalogue, the TTArtisan AF 40mm f/2 is the most plausible budget pick. It's a fast 40mm prime for full frame cameras, which gives you a soft background and a focal length close to what many people use for portraits. The guide doesn't describe it as cheap, though, and I can't quote its price here, so check the price on its page before you decide.

The Zeiss Batis 40mm f/2 CF has the same focal length and aperture for full frame, but it's a premium lens. You pay for the build and optics, so it suits you if you want the best rendering and can spend more. It isn't the value choice.

The Fujifilm GF 50mm f/3.5 is a medium format lens, so it only fits a Fujifilm GF body. It's also a slower f/3.5, so it's not the one to pick for a cheap portrait lens unless you already shoot that system.

Whichever you choose, the guide suggests spending about as much on the lens as on the body. A cheap fast 50mm prime is its recommended portrait lens for a first kit. Lenses also hold their value well, so buying one used is a low-risk way to try it. See how to split the budget and what holds its value.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.