I suppose that this issue had to arise, sooner or later.
Extension cords, strictly speaking, are not forbidden. A properly sized cord is perfectly proper way to temporarily bring power to where you need it.
The key word here is 'temporarily.'
The code has rules for the placement of receptacles. Unfortunately, these rules are often used improperly as a 'design guide.' as a way for the contractor to do as little as possible, yet still 'meet code.' As a direct result, receptacle are often very poorly placed - at least, poorly placed for nearly ever occupant.
It's very rare for a homeowner to have any say where the receptacles will be placed; the tenant never has a say.
So, there are millions of extension cords bought every year. I suspect that the vast majority of them are less than six feet long. These are plugged in and left in place - for years at a time. When you move, the new occupant will probably buy an identical cord to use exactly as you did.
IMO, simple code compliance is no substitute for good design. Yet, that's not the way the world works. The simple reality is that cords are here to stay- and no parsing of the code book will change that.