I'm trying to figure out if there's a way to prevent BLEDevice.h from allocating memory when not in use since it allocates ~25K even if init has not been called.
Compiling with the --verbose flag gave me more clues and it seems that the amount of BLE statically allocated variables are the reason behind this extra RAM usage.
// With BLE
.dram0.bss 47640
// Withouth BLE
.dram0.bss 28368
So I guess the only way to optimize this would be modifying Bluetooth stack source code.