When adding WMS layers through Python plugin/script I run into issue with QGIS stripping of vendor parameters. I found following issue that was closed (https://issues.qgis.org/issues/12255). Proposed solution doesn't with checking settings in GUI "Ignore GetMap/GetTile URI reported in capabilities" is not good for my case, as I am doing it from Python script.
Is there way to activate this setting from Python script. Or is there any other work around?
Also the solution in this post (Non-standard WMS parameters not sent in GetMap requests via QGIS?) is not getting me anywhere, because WMS has to get & not encoded to parse it correctly.