Please note we are switching to Discord for questions and discussions on PyPSA-Eur, see here:
You can set the marginal_cost for generators and links as a time series.
Loads don't support this, but if you place them on a dedicated bus behind a dedicated link, the link can represent the costs.
Not that load is not flexible by default, i.e. always has to be met.
Best,
Johannes