This is an excellent question and is, I have found, one that is being surprisingly ignored through all the hubub around section 174 / software / R&D, considering how many consulting shops and agencies are out there doing contract software development.

As best as I can determine, through reading the IRS's guidance and consulting with an industry expert, the answer is that doing software dev as a contractor/consultant does not qualify as R&D activities that must be capitalized if you're the contractor/consultant. Here is the language with a guiding example w/ analysis. The key being that the contractor bears no "financial risk" or right to use the software for its own purposes.

https://www.irs.gov/pub/irs-drop/n-23-63.pdf

SECTION 6. RESEARCH PERFORMED UNDER CONTRACT
.01 Purpose. The Treasury Department and the IRS intend to propose rules in
forthcoming proposed regulations consistent with the interim guidance provided in this
section 6, which provides taxpayers with clarity in determining whether costs paid or
incurred for research performed under contract are SRE expenditures under § 174.
.02 Defined terms. For purposes of this section 6:
-27-
(1) Research provider. The term research provider means the party that contracts
with a research recipient (as defined in section 6.02(2) of this notice) to:
(a) perform research services for the research recipient with respect to an SRE
product, or
(b) develop an SRE product (as defined in section 6.02(4) of this notice) that the
research recipient acquires from the research provider.
(2) Research recipient. The term research recipient means the party that contracts
with the research provider to:
(a) perform research services for the research recipient with respect to an SRE
product, or
(b) develop an SRE product that the research recipient acquires from the
research provider.
(3) Financial risk. The term financial risk means the risk that the research provider
may suffer a financial loss related to the failure of the research to produce the desired
SRE product.
(4) SRE product. The term SRE product means any pilot model, process, formula,
invention, technique, patent, computer software, or similar property (or a component
thereof) that is subject to protection under applicable domestic or foreign law. For
example, mere know-how gained by a research provider through the performance of
research services for a research recipient that is not subject to protection under
applicable domestic or foreign law does not give rise to an SRE product in the hands of
the research provider.
.03 Treatment of costs paid or incurred by research recipient. The treatment of costs
-28-
paid or incurred by the research recipient is governed by the principles set forth in
§ 1.174-2(a)(10) and (b)(3).
.04 Treatment of costs paid or incurred by research provider. If the research
provider bears financial risk under the terms of the contract with the research recipient,
then costs paid or incurred by the research provider that are incident to the SRE
activities (see section 4.03 of this notice) performed by the research provider under the
contract are SRE expenditures. However, even if the research provider does not bear
financial risk under the terms of the contract with the research recipient, if the research
provider has a right to use any resulting SRE product in the trade or business of the
research provider or otherwise exploit any resulting SRE product through sale, lease, or
license, then costs paid or incurred by the research provider that are incident to the
SRE activities performed by the research provider under the contract are SRE
expenditures of the research provider for which no deduction is allowed except as
provided in § 174(a)(2), regardless of whether the research recipient is required to treat
its costs as SRE expenditures under section 6.03 of this notice. For purposes of the
preceding sentence, a research provider will not be treated as having a right to use the
SRE product in the trade or business of the research provider or otherwise exploit the
SRE product through sale, lease, or license if such right is available to the research
provider only upon obtaining approval from another party to the research arrangement
that is not related to the research provider within the meaning of § 267 or § 707.
.05 Example. The following example illustrates the rules set forth in section 6 of this
notice.
(1) Facts. Company C engages Company D, a contractor located in the United
-29-
States, to develop an SRE product for use in Company C’s trade or business. The
activities undertaken by Company D are undertaken upon Company C’s order, and
Company D makes no performance guarantees with respect to the SRE product.
Company C will pay Company D a fixed sum of $25,000 plus an amount equivalent to
Company D’s actual expenditures. Company D does not have any right to use or
otherwise exploit any resulting SRE product. In 2023, Company D incurs $125,000 of
expenditures to successfully develop the product in the United States, and Company C
pays to Company D $150,000 pursuant to the terms of the contract.
(2) Analysis. Under section 6.04 of this notice, Company D may not treat the
$125,000 of expenditures it incurs to develop the SRE product on behalf of Company C
as SRE expenditures under § 174 because (i) Company D does not bear financial risk,
and (ii) Company D does not have any right to use or otherwise exploit any resulting
SRE product. Under section 6.03 of this notice, the $150,000 paid by Company C is an
amount paid to another party for research or experimentation undertaken on Company
C’s behalf under § 1.174-2(a)(10) and (b)(3) and is thus an SRE expenditure under
section 4.02(2) of this notice. The applicable § 174 amortization period is 5 years (60
months) because the research is performed by Company D in the United States.
Company C’s location is not relevant for determination of the applicable § 174
amortization period.