For a postdoctoral/Ph.D. position in Mathematics in Europe, can I make this somewhat irregular request?
In several European countries, for example Germany, Switzerland, or Austria, it will be possible to fill positions in part-time. Whether you then actually work only part-time or not is a different question. In these countries, there is in most cases not a big difference between PhD students and post-docs regarding organizational details of employment, or even salary on a full-time position.

So the way I see your plan possibly working is as follows: A professor has funding to employ someone full-time for 2 years. You could then try to argue that in addition to working on the particular project, you also need time to educate yourself further and get only a half-time position, but stretch that to 4 years. You may want to communicate that it still means that you are working or studying full-time on project-related topics. If the funding is flexible regarding the year when it is spent (which is sometimes, but not always, the case), then I'd guess you have good chances that people are willing to make that deal.

This plan is probably best discussed with the professor offering the position, informally before you apply for the position, or when you go for an interview.