It seems this was planned for the Adafruit BMP280 library but not implemented. Looking at
Adafruit_BMP280.h we see commented code that has a method
class Adafruit_BMP280_Unified : public Adafruit_Sensor
Adafruit_BMP280_Unified(int32_t sensorID = -1);
bool begin(uint8_t addr = BMP280_ADDRESS, uint8_t chipid = BMP280_CHIPID);
void getTemperature(float *temp);
void getPressure(float *pressure);
float pressureToAltitude(float seaLevel, float atmospheric, float temp);
float seaLevelForAltitude(float altitude, float atmospheric, float temp);
In another library, BMP280-arduino-library, I found a function that seems to work:
double BMP280::sealevel(double P, double A)
// Given a pressure P (mb) taken at a specific altitude (meters),
// return the equivalent pressure (mb) at sea level.
// This produces pressure readings that can be used for weather measurements.
First, I just copied that function into my code (without the class name), due to the friendly pizza license. Later I switched to that library and it also worked fine.