What 40 KB is good for
40 KB buys a genuinely good identity photograph. At the dimensions application forms require, this is more budget than the image needs, which means the compressor spends it on quality rather than fighting the limit.
On the web, 40 KB is a useful ceiling for anything that appears more than once on a page. Card images, author avatars, and logo variants at this size add up slowly enough that they never dominate a page's total weight.